Trying to run this simple example here:
http://blog.vrplumber.com/index.php?/archives/2324-Sphere-rendering-with-numpy....html
I get:
C:\Users\Greg\Downloads>shader_sphere.py
WARNING:OpenGL.arrays.numpymodule:Unable to load numpy_formathandler accelerator from OpenGL_accelerate
WARNING:context:Python Image Library (PIL) not installed, no Image support available
http://www.pythonware.com/products/pil/index.htm
WARNING:context:Unable to load node implementation for MMImageTexture: 'module' object has no attribute 'MMImageTexture'
Traceback (most recent call last):
File "C:\Users\Greg\Downloads\shader_sphere.py", line 116, in <module>
TestContext.ContextMainLoop()
File "C:\Python27\lib\site-packages\openglcontext-2.1.0a11-py2.7.egg\OpenGLContext\glutcontext.py", line 154, in ContextMainLoop
render = cls( *args, **named)
File "C:\Python27\lib\site-packages\openglcontext-2.1.0a11-py2.7.egg\OpenGLContext\glutcontext.py", line 30, in __init__
glutInitDisplayMode( self.DISPLAYMODE )
File "C:\Python27\lib\site-packages\pyopengl-3.0.1-py2.7.egg\OpenGL\platform\baseplatform.py", line 340, in __call__
self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInitDisplayMode, check for bool(glutInitDisplayMode) before calling
I installed PIL, but I still get:
C:\Users\Greg\Downloads>shader_sphere.py
WARNING:OpenGL.arrays.numpymodule:Unable to load numpy_formathandler accelerator from OpenGL_accelerate
Traceback (most recent call last):
File "C:\Users\Greg\Downloads\shader_sphere.py", line 116, in <module>
TestContext.ContextMainLoop()
File "C:\Python27\lib\site-packages\openglcontext-2.1.0a11-py2.7.egg\OpenGLContext\glutcontext.py", line 154, in ContextMainLoop
render = cls( *args, **named)
File "C:\Python27\lib\site-packages\openglcontext-2.1.0a11-py2.7.egg\OpenGLContext\glutcontext.py", line 30, in __init__
glutInitDisplayMode( self.DISPLAYMODE )
File "C:\Python27\lib\site-packages\pyopengl-3.0.1-py2.7.egg\OpenGL\platform\baseplatform.py", line 340, in __call__
self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInitDisplayMode, check for bool(glutInitDisplayMode) before calling
You are missing GLUT, though why I can't say, as it is supposed to be installed with PyOpenGL in the windows installer.
This is Windows 7 x64 with 64-bit Python. The PyOpenGL installer does not work with 64 bit Python (no installers do. see: http://bugs.python.org/issue6792 )
Instead I did: easy_install pyopengl
Then you will need a 64-bit build of GLUT, I'm guessing. FreeGLUT or GLUT32 should work.
Hi! This source code do not import GLUT!
http://bazaar.launchpad.net/~mcfletch/openglcontext/trunk/annotate/head%3A/tests/shader_sphere.py
Do you add:
from OpenGL.GLUT import *
in your code?
Oh, and check if you have glu32.dll in Windows/SysWOW64 (if not copy it from Windows/System32), it can help (as i 64bit system there are too folders for libs, and sometimes Win do not care to check them both)
Sorry. It should be freeglut.dll. import statement is good. Check freeglut website to get compiled Win libraries, but remeber to copy them also to SysWOW64.