物体种类
glutWireCube(); //线框立方体
glutWireSphere(); //线框球体
glutWireCone(); //线框圆锥体
glutWireCylinder(); //线框圆柱体
glutWireTorus(); //线框圆环
glutWireDodecahedron(); //线框正十二面体
glutWireOctahedron(); //线框正八面体
glutWireTetrahedron(); //线框正四面体
glutWireIcosahedron(); //线框的正二十面体
glutWireRhombicDodecahedron(); //线框斜十二面体
glutWireSierpinskiSponge (); //线框Sierpinski海绵体
glutWireTeapot(); //线框茶壶
glutSolidCube(); //实线立方体
glutSolidSphere(); //实心球体
glutSolidCone(); //实心圆锥体
glutSolidCylinder(); //实心圆柱体
glutSolidTorus(); //实心圆环
glutSolidDodecahedron(); //实心正十二面体
glutSolidOctahedron(); //实心正八面体,
glutSolidTetrahedron(); //实心正四面体
glutSolidIcosahedron(); //实心的正二十面体
glutSolidRhombicDodecahedron(); //实心斜十二面体
glutSolidSierpinskiSponge() //实心Sierpinski海绵体
glutSolidTeapot(); //实心茶壶
物体示例
实心球
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
def drawFunc():
glClear(GL_COLOR_BUFFER_BIT)
glRotatef(0.1,0,2,0)
glutSolidSphere(0.2,10,8);
glFlush()
def main():
glutInit()
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA)
glutInitWindowPosition(0,0)
glutInitWindowSize(400,400)
glutCreateWindow("object")
glutDisplayFunc(drawFunc)
glutIdleFunc(drawFunc)
glutMainLoop()
if __name__=="__main__":
main()
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210330101556681.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM4NjQxOTg1,size_16,color_FFFFFF,t_70)
线形立方体
def drawFunc():
glClear(GL_COLOR_BUFFER_BIT)
glRotatef(0.1,0,2,0)
glutWireCube(1)
glFlush()
def main():
glutInit()
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA)
glutInitWindowPosition(0,0)
glutInitWindowSize(400,400)
glutCreateWindow("object")
glutDisplayFunc(drawFunc)
glutIdleFunc(drawFunc)
glutMainLoop()
if __name__=="__main__":
main()
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210330101706441.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM4NjQxOTg1,size_16,color_FFFFFF,t_70)
混合物体
def drawFunc():
glClear(GL_COLOR_BUFFER_BIT)
glRotatef(0.1,0,2,0)
glutWireTeapot(0.5)
glutWireCone(0.4,0.8,12,9)
glutWireCube(1)
glutSolidSphere(0.2,10,8);
glFlush()
def main():
glutInit()
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA)
glutInitWindowPosition(0,0)
glutInitWindowSize(400,400)
glutCreateWindow("object")
glutDisplayFunc(drawFunc)
glutIdleFunc(drawFunc)
glutMainLoop()
if __name__=="__main__":
main()
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210330101900358.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM4NjQxOTg1,size_16,color_FFFFFF,t_70)