问题描述
我无法使用 C++ 中的 OpenGL 库函数 glutSolidSphere() 创建一个简单的 3D 球体.
I am not able to create a simple 3D sphere using the OpenGL library function glutSolidSphere() in C++.
这是我尝试过的:
推荐答案
在 OpenGL 中,您不创建对象,您只绘制它们.绘制完成后,OpenGL 不再关心您发送的几何图形.
In OpenGL you don't create objects, you just draw them. Once they are drawn, OpenGL no longer cares about what geometry you sent it.
glutSolidSphere
只是向 OpenGL 发送绘图命令.然而,它并没有什么特别之处.而且由于它与 GLUT 相关联,因此我不会使用它.相反,如果您的代码中确实需要一些领域,那么为自己创建 if 怎么样?
glutSolidSphere
is just sending drawing commands to OpenGL. However there's nothing special in and about it. And since it's tied to GLUT I'd not use it. Instead, if you really need some sphere in your code, how about create if for yourself?
这篇关于使用 Visual C++ 在 Opengl 中创建 3D 球体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!