- python opengl drawing teapot
- Archived: Unofficial Windows Binaries for Python Extension Packages
- 106.07.05 使用python3執行PyOpenGL
- Need to Install PyOpenGL (Windows)
- PyOpenGL :: OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling
用 example code 來測試:
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
def Draw():
glClear(GL_COLOR_BUFFER_BIT)
glutWireTeapot(0.5)
glFlush()
glutInit()
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA)
glutInitWindowSize(300,300)
glutCreateWindow(b"teapot")
glutDisplayFunc(Draw)
glutIdleFunc(Draw)
glutMainLoop()
if __name__ == '__main__':
Draw()
出現 Error:
Traceback (most recent call last):
File "D:\teapot.py", line 11, in &;t;module>
glutInit()
File "D:\Python311\Lib\site-packages\OpenGL\GLUT\special.py", line 333, in glutInit
_base_glutInit( ctypes.byref(count), holder )
File "D:\Python311\Lib\site-packages\OpenGL\platform\baseplatform.py", line 423, in __call__
raise error.NullFunctionError(
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling
結果google 說是 pypl official 的 opengl package 沒有包到兩個 dlll...
沒有留言:
張貼留言