简体   繁体   English

如何 openGL 中的 model 蟋蟀树桩

[英]How to model cricket stumps in openGL

I am new to OpenGL and want to make cricket stumps for my mini project.我是 OpenGL 的新手,想为我的迷你项目制作板球树桩

As far as I know the base is something like a cone, and then a cylinder comes above it, but I am not able to model it.据我所知,底座类似于圆锥体,然后在其上方出现一个圆柱体,但我无法 model 它。

Would you like to tell me how can I model it in OpenGL for 3D realization?您想告诉我如何在 OpenGL 中实现 model 以实现 3D?

You don't really model things in OpenGL.你在 OpenGL 中并没有真正的 model 东西。 All OpenGL knows about is triangles. OpenGL 只知道三角形。 Colored triangles, different angled/sized triangles, textured triangles, etc, etc. OpenGL doesn't deal with modelling, that's your job.彩色三角形、不同角度/大小的三角形、纹理三角形等。OpenGL 不处理建模,那是你的工作。

You can either use modelling software (3dsmax, etc.) to create the model, export it, and then figure out how to convert a model into OpenGL's triangles.您可以使用建模软件(3dsmax 等)创建 model,将其导出,然后弄清楚如何将 model 转换为 OpenGL 的三角形。 Or you can figure out all the triangles you want to draw yourself and just hard code it in OpenGL.或者你可以找出你想自己画的所有三角形,然后在 OpenGL 中硬编码。 Or you can find some sort of external library (I suggest GLU) that sits on top of OpenGL and knows how to break down certain common shapes into the triangles.或者你可以找到某种位于 OpenGL 之上的外部库(我建议使用 GLU),并且知道如何将某些常见的形状分解为三角形。 Check this out.看看这个

The easier way would be to use gluCylinder which can generate cylinder and cones.更简单的方法是使用可以生成圆柱体和圆锥体的gluCylinder Here is a NeHe sample .这是一个NeHe 样本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM