如何解决我正在python中尝试Opengl并且Iam收到此错误
第一个Python OpenGL程序 ogl1.py
from OpenGL.GLUT import *
from OpenGL.GL import *
from OpenGL.GLU import *
def draw():
glClear(GL_COLOR_BUFFER_BIT)
glutWireTeapot(0.5)
glFlush()
glutInit(sys.argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)
glutInitWindowSize(250,250)
glutInitWindowPosition(100,100)
glutCreateWindow("My Second OGL Program")
glutDisplayFunc(draw)
glutMainLoop()
错误
Traceback (most recent call last): File "C:\Users\Jahnavi Yeadoti\AppData\Local\Programs\Python\Python38\pythonprojact\teapot.py",line 15,in <module> glutInit(sys.argv) File "C:\Users\Jahnavi Yeadoti\AppData\Local\Programs\Python\Python38\lib\site-packages\OpenGL\GLUT\special.py",line 333,in glutInit _base_glutInit( ctypes.byref(count),holder ) File "C:\Users\Jahnavi Yeadoti\AppData\Local\Programs\Python\Python38\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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。