CADDIT CAD CAM CNC Software - download AutoCAD compatible design software progeCAD Alibre T-FLEX and more
CADDIT Website Knowledge Base Search:
 Downloads
 Distutils
 Networking
 XML
 OpenGL
 FAQ
 Getting Help

 

Digg This!   

Save to del.icio.us

 

PythonD 32-bit python for DOS and Windows


OpenGL and PythonDDOS OpenGL Python script with 3D navigation

PyOpenGL (2.0.1.04 beta)  has been ported to PythonD using the MESA toolkit. This module provides DOS-based systems  with 3D scripting and real-time rotation - even those systems that are NT-based. NT function is possible using Daniel Borca´s new VGA driver. Note that this PythonD module is still in testing.

Installation and Configuration:

* Download the PyOpenGL module from the base distribution section of the general download page. Like all PythonD (and DJGPP) packages, the PyOPenGL package should be extracted from the top level directory of your PythonD installation, with an unzipper that preserves the zipped directory structure. You also probably need the OpenGL libraries glut.dxe, glu.dxe and gl.dxe. they must be placed in a subdirectory declared in the environment variable LD_LIBRARY_PATH. For example, if python is installed in C:\python, then these DXEs will be extracted to C:\python\lib by default, and you must add this line to you environment:
SET LD_LIBRARY_PATH=/dev/c/python/lib (or “C:\\python\\lib” might also be OK)
If you have DJGPP, you should have extracted PythonD there, and you will need:
SET LD_LIBRARY_PATH=/dev/env/DJDIR/lib
* Note: for DJGPP users, check your DJGPP.ENV file, as this may already be declared for you there. All general DJGPP.ENV settings will be applied to PythonD, so this might be a better solution for those wishing to limit DJGPP-specific variables to DJGPP applications.

* Because of MMX optimizations in the GLUT driver, DMESA_GLUT_BPP also should be defined in the environment. It sets the Bits Per Pixel, and it must be a product of 8. Depending on your VESA chip, you may use 8, 16, maybe 24, etc. For NT based systems you need the following setting:
                                          set DMESA_GLUT_BPP=8

Known Limitatations:

* Like all PythonD modules, PyOpenGL runs only in a single window, using a single process.

* Note that there are no plans to support TOGL. PyOpenGL packages requiring TOGL/tkinter must be changed before they can used with PythonD.

* PyOpenGL has been compiled with Numeric support. Many of the demos require Numeric be installed. Numerical Python 23.0 is available for PythonD on the general downloads page.

* Older versions of the new “numarray” module has been known to interfere with PythonD OepnGL operation.

* As of MESA 5.01, only Matrox Millennium I (MGA2064W) and 3dfx cards (anything from Banshee to Voodoo5/Napalm) can handle DMESA sigle-buffered mode, Otherwise DMESA does all its work on a VESA based software level, and will *NEED* a double-buffered glutInitDisplayMode (“GLUT_DOUBLE”).

* Using PythonD OpenGL under NT and W2K systems only: takes some special care. The following information does not apply to users of Windows XP, which allows DOS VESA modes. NT 4 and Windows 2000 use the following settings in PythonD scripts when calling the following functions:

glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | ... )
glutInitWindowSize(320, 200)
glutInitWindowPosition(0, 0)
InitGL(320, 200)

...the reason being that most NT and Windows 2000 graphics drivers only allow VGA DOS modes. This has officially changed with WindowsXP, but PythonD remains untested under XP systems. Results may vary depending on graphics card, etc.