简体   繁体   中英

How to model cricket stumps in openGL

I am new to OpenGL and want to make cricket stumps for my mini project.

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.

Would you like to tell me how can I model it in OpenGL for 3D realization?

You don't really model things in OpenGL. All OpenGL knows about is triangles. Colored triangles, different angled/sized triangles, textured triangles, etc, etc. OpenGL doesn't deal with modelling, that's your job.

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. Or you can figure out all the triangles you want to draw yourself and just hard code it in 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. Check this out.

The easier way would be to use gluCylinder which can generate cylinder and cones. Here is a NeHe sample .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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