在OpenTK中绘制四面体
我使用 OpenTK 制作了一个简单的旋转四面体应用程序。我的问题是最后一张脸不见了。我想是因为我的顶点顺序错误。
GL.Begin(BeginMode.Triangles);
GL.Color3(Color.Silver);
GL.Vertex3(-0.269f, -0.5f, -0.5f);
GL.Vertex3(0.598f, -0.5f, 0f);
GL.Vertex3(-0.269f, -0.5f, 0.5f);
GL.Color3(Color.Honeydew);
GL.Vertex3(-0.269f, -0.5f, -0.5f);
GL.Vertex3(0.0f, 0.5f, 0f);
GL.Vertex3(-0.269f, -0.5f, 0.5f);
GL.Color3(Color.Moccasin);
GL.Vertex3(-0.269f, -0.5f, 0.5f);
GL.Vertex3(0.598f, -0.5f, 0f);
GL.Vertex3(0.0f, 0.5f, 0f);
GL.Color3(Color.IndianRed);
GL.Vertex3(0.598f, -0.5f, 0f);
GL.Vertex3(-0.269f, -0.5f, 0.5f);
GL.Vertex3(0.0f, 0.5f, 0f);
GL.End();
获得四面体的正确顺序是什么?我应该使用另一个 BeginMode 吗?
提前致谢, 丹尼尔
I made a simple spinning tetrahedron application with OpenTK. My problem is that the last face is missing. I guess because I'm making a wrong order of vertices.
GL.Begin(BeginMode.Triangles);
GL.Color3(Color.Silver);
GL.Vertex3(-0.269f, -0.5f, -0.5f);
GL.Vertex3(0.598f, -0.5f, 0f);
GL.Vertex3(-0.269f, -0.5f, 0.5f);
GL.Color3(Color.Honeydew);
GL.Vertex3(-0.269f, -0.5f, -0.5f);
GL.Vertex3(0.0f, 0.5f, 0f);
GL.Vertex3(-0.269f, -0.5f, 0.5f);
GL.Color3(Color.Moccasin);
GL.Vertex3(-0.269f, -0.5f, 0.5f);
GL.Vertex3(0.598f, -0.5f, 0f);
GL.Vertex3(0.0f, 0.5f, 0f);
GL.Color3(Color.IndianRed);
GL.Vertex3(0.598f, -0.5f, 0f);
GL.Vertex3(-0.269f, -0.5f, 0.5f);
GL.Vertex3(0.0f, 0.5f, 0f);
GL.End();
What is the correct order to get the tetrahedron? Should I use another BeginMode?
Thanks in advance,
Daniel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在此页面 它提供了似乎对它们有用的坐标和 opengl 调用的列表。
也就是说,这种事情:
if you look for the Tetrahedron::draw() function on this page it provides a list of coords and opengl calls that seem to be working for them.
Namely, this kind of thing: