【发布时间】:2013-09-14 13:37:35
【问题描述】:
我正在尝试使用 PyOpenGL(以及 PyODE)绘制一个实心圆柱体,但是我遇到了以下错误:
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutSolidCylinder, check for bool(glutSolidCylinder) before calling
我有以下三个导入,并且一直在使用其他 glut* 调用(glutSolidSphere、glutSolidCube 等)没有问题,但是这个给我带来了问题。
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
...
glutSolidCylinder(RADIUS, LENGTH, SLICES, STACKS)
我使用的是 Python 2.7,当我使用 print(bool(glutSolidCylinder)) 进行测试时,我收到了 False。
我也使用 Pip 来安装 PyOpenGL。
【问题讨论】:
标签: python-2.7 pyopengl