It opens the main application window with n(). It defines a draw() function and attaches it to the canvas, so that it will be drawn each animation frame. It imports the aphics module with the standard set of drawing commands. This will open an application window with the output of your script. From the command line, you can run a script with: python example.py (or command-R in TextMate) You can use the IDLE editor bundled with Python. For users coming from NodeBox for Mac OS X: this NodeBox for OpenGL does not have a built-in code editor. If you want to activate them, you need to compile them from source. NOGL contains C extensions for faster mathematics. If you get an "import pyglet" error, make sure that Pyglet is installed in site-packages/ too. > import sys if MODULE not in sys.path: (MODULE) In your script, add the location of NodeBox to sys.path, before importing it: usr/lib/python2.5/site-packages/ on Unix,Ĭ:\python25\Lib\site-packages\ on Windows. Library/Python/2.5/site-packages/ on Mac, The standard location depends on your operating system, for example: Put the nodebox/ folder in the standard location for modules so it is available to all scripts. Put the nodebox/ folder in the same folder as your script. There are three basic ways to accomplish this: To be able to import NodeBox in your scripts, Python needs to know where the module is located. If that doesn't work, download the latest version manually. If you have pip, you can automatically download and install from the PyPi repository: If this is not the case, try updating to a new driver. Your video hardware needs support for OpenGL 2.0. Pyglet 1.4 : an installer can be downloaded from Python 2.5-6 : an installer can be downloaded from On Mac OS X 10.6 (Snow Leopard), you need to install a 32-bit version of Python (Pyglet won't work as expected with the preinstalled 64-bit version). Note: on Mac OS 10.5, Python is already installed. It works on all platforms if you have Python and Pyglet installed. NodeBox for OpenGL is built on the excellent Pyglet module. Its purpose is to implement a small game engine for "City In A Bottle" ( ).īSD, see LICENSE.txt for further details. ), offscreen rendering, animation
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |