PDA

View Full Version : Twisted cylinders



alabama
09-12-2006, 07:03 AM
Hi!
I've to draw two twisted cylinders of two different colors, but I can't import a model because this shape change at runtime.
How can I make this in OpenGL?
Thanks!

Giacomo

mikael_aronsson
09-15-2006, 02:27 PM
Look at the source code for GLU (you can find it for example if you download Mesa www.mesa3d.org) (http://www.mesa3d.org))

Adding the twist is very simple (as long as it is along the cylinder center axis) once you figure out how to create the cylinder itself, and that is also very easy.

Give it a try and see for yourself.

alabama
09-17-2006, 08:06 AM
I've download from mesa3d.org the packagage demos and lib, but I didn't find any examples of twisted cylinders, can you post some code?
Thanks a lot!

mikael_aronsson
09-17-2006, 09:23 AM
As I said, Mesa has the GLU source for creating a cylinder in OpenGL, to add twisting is pretty simple so you can do that yourself without to much work.