hello.

I have some 2d shapes that I would like to extrude for a depth, and the result must be a 3d solid.

The 2d shape is a bidimensional set of 2d vertexes.

How i can create the 3d vertexes , the triangles and indexes of the triangles ?

I would use only opengl and c++ math code nor glut or glew ecc…

Thanks.

Extrusion is the easy part obviously. But OpenGL does not help you filling in the front face. Although GLUT offers some functions to tesselate, you will need to do that on your own.

It’s very easy. Just make a copy of the 2D shape and connect the edges between them. Every edge pair will form a quad, or two triangles if you want.

You don’t need OpenGL to do this either.