Hi,
Is there a way to easily draw a 3D spring in OpenGL? It doesn’t have to be fancy. The spine (central line) is always straight. I know VRML has tools to draw springs, donuts, etc. Your help is much appreciated.
Tony
Hi,
Is there a way to easily draw a 3D spring in OpenGL? It doesn’t have to be fancy. The spine (central line) is always straight. I know VRML has tools to draw springs, donuts, etc. Your help is much appreciated.
Tony
I am not sure what you call springs, but if you need some pre-defined objects like torus (donut ) or the old good teapot, try to use GLUT. It has some predefined Objects you can call without creating it from ground up.
cu
Tom
One way would be to use a 3D model editor to model the spring how you want. There are many free modelers out there so take your pick. Or you could generate a spring using math. You could do something like this: http://mathworld.wolfram.com/Slinky.html and once your curve is generated to your specs, the next step is to tessellate it.
-SirKnight
A spring is a generalised cylinder with a circle cross-section and a ‘springy’ axis.
Conceptually, then:
and that’s it. the hardest part is lofting 2D points into 3D, I guess.
OpenGL is not a scene graph.
OpenGL is not a model library.
OpenGL is a high-level abstraction for the specific capabilities of 3D rendering hardware. Nothing more; nothing less.
Think of OpenGL as a device driver.
Why can’t you just get the math to draw a torus, then modify the equation to vary the height, which should expand it into something that looks like a spring?