OK here's an easy one, but I got it wrong. What kind of rotations/translations are needed to render a glu cylinder or cone along a axis from px,py,pz to qx,qy,qz. I can figure out the y axis rotation angle and the up down rotation angle but when combining the rotations it doesn't work right.

Mazy

06-01-2003, 11:19 PM

v=normalise(q-p)

glrotate(angle, v.x, v.y, v.z);

beginner620824

06-02-2003, 05:27 PM

you need to caculate 2 angles A and B. Suppose the cylinder first lies alone Z, you rotate it angle A alone Y and then rotate it angle B alone X, that is: