Panda3D Manual: Starting Panda3D
Creating a New Panda3D ApplicationShowBaseTo start Panda3D, create a text file and save it with the .py extension. PYPE, SPE and IDLE are Python-specific text-editors, but any text editor will work. Enter the following text into your Python file: from direct.showbase.ShowBase import ShowBase Here we made our main class inherit from DirectStart
import direct.directbase.DirectStart The import line automatically constructs an instance of ShowBase, which starts the engine and creates an empty window. Because ShowBase uses Python's Running the ProgramTo run your program on Windows or Mac, enter the following in a terminal (command prompt): ppython filename.py To run it on GNU/Linux, enter the following in a terminal: python filename.py If Panda3D has been installed properly, a grey window titled Panda appears. There is nothing we can do with this window, but that will change shortly.
© Carnegie Mellon University 2010 |