PDA

View Full Version : Cartesian co-ords to rotations



rj_gilbert
09-05-2000, 05:22 AM
This is more of a geometry question than an OpenGL one...

I'm trying to draw a cylinder of radius R with its end points defined in cartesian co-ordinates (X1,Y1,Z1) and (X2,Y2,Z2).

The gluCylinder function seems to create a cylinder with one end at (0,0,0) along the Z axis. I guess I have to use glTranslate and glRotate to move the cylinder where I want it, but what combination of rotation angles and axes do I use?

Thanks,

Rich Gilbert.