To be able to render with good performance and display effects like transparency correctly, Panda3D automatically sorts the scene geometry and puts it into "cull bins", so vertices that share the same texture, for example, are sent to the graphics card in one batch.
Panda3D allows you to change the rendering order manually, to achieve custom scene sorting, which is what you will learn in this recipe.
This recipe requires the base code created in Setting up the game structure found in Chapter 1, to which the following sample code will be added.
Let's get started with this recipe's tasks:
Add the following code to
Application.py
:from direct.showbase.ShowBase import ShowBase from direct.actor.Actor import Actor class Application(ShowBase): def __init__(self): ShowBase.__init__(self) self.panda = Actor("panda", {"walk": "panda-walk"}) self.panda.reparentTo(render) self.panda.loop("walk") self...