Panda3D Manual: Starting Panda3D
  <<prev top next>>     

To start Panda3D, create a text file and save it with the .py extension. PYPE and IDLE are Python-specific text-editors, but any text editor will work. Enter the following text into your Python file:

import direct.directbase.DirectStart
run()

DirectStart loads most of the other Panda3D modules, and causes the 3D window to appear. The run subroutine contains the Panda3D main loop. It renders a frame, handles the background tasks, and then repeats. It does not normally return, so it only needs to be called once and must be the last line in your script. In this particular example, there will be nothing to render, so you should expect a window containing an empty grey area.

To run your program, type this at the command prompt:

ppython filename.py

If Panda3D has been installed properly, a gray window titled Panda appear. There is nothing we can do with this window, but that will change shortly.

  <<prev top next>>