Creating solid primitives

How can I create solid primitives in OpenGL with userdefined features? For example I want draw a
cube with rounded edges. My idea is:

First I draw the outlines and the planes and then I will changed this in a solid primitive. Is there there any possibility to do this in OpenGL?

Thanks for your answers?


Hi !

Nope, you will need to create mesh for the primitive, if it’s just a box with rounded corners you could always use glu do get that, but if you want a more generic method to create solid primitives you need to create a mesh yourself for them.

OpenCascade ( for example can create complex primitives that can be modified with different operations to round corners, cut holes, create dents and things like that, but that might be some overkill (12000 header files and a 150MB download…)

You could also have a peek at the nurbs support in glu, this can be used to create many primitives.