Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Close
From: <jrodriguez@cf...>  20011008 16:03:07

Hi list, I have a trouble with glRotate, I want to connect two spheres with a cylinder, I already obtained the t= hree angles to rotate the cylinder for orienting it correctly, but when I dr= aw the cylinder the orientation is incorrect! I don=B4t know what happens! anybody could explainme how works glRotate? I have understood that I write: glRotate(angle, x, y, z) x, y, z are a vector on which I rotate the angle... I wrote: glRotate(angle1, 1, 0, 0) //angle is alfa, this mean is on the X axis glRotate(angle2, 0, 1, 0) //angle is beta, this mean is on the Y axis glRotate(angle3, 0, 0,1) //angle is gama, this mean is on the Z axis what I am doing wrong? Please helpme! rick= 
From: <jrodriguez@cf...>  20011008 17:21:32

Hi guys, I sent this messages from another account, I didn't realize my= mistake if anybody answered me, please could resend me his answer,,, rick. = =20 jrodriguez@... = =20 e.gob.mx To: mesa3dusers@...= rceforge.net =20 cc: = =20 05/10/01 Subject: Re: [Mesa3dusers= ] I cant orienting a cylinder... =20 01:27 p.m. = =20 = =20 = =20 Hi list, I have a trouble with glRotate, I want to connect two spheres with a cylinder, I already obtained the t= hree angles to rotate the cylinder for orienting it correctly, but when I dr= aw the cylinder the orientation is incorrect! I don=B4t know what happens! anybody could explainme how works glRotate? I have understood that I write: glRotate(angle, x, y, z) x, y, z are a vector on which I rotate the angle... I wrote: glRotate(angle1, 1, 0, 0) //angle is alfa, this mean is on the X axis glRotate(angle2, 0, 1, 0) //angle is beta, this mean is on the Y axis glRotate(angle3, 0, 0,1) //angle is gama, this mean is on the Z axis what I am doing wrong? Please helpme! rick _______________________________________________ Mesa3dusers mailing list Mesa3dusers@... https://lists.sourceforge.net/lists/listinfo/mesa3dusers = 
From: Eric Plante <eric.plante@di...>  20011009 18:33:59

Resending my reply to the list, seems easier that way...  > glRotate(angle1, 1, 0, 0) //angle is alfa, this mean is on the X axis > glRotate(angle2, 0, 1, 0) //angle is beta, this mean is on the Y axis > glRotate(angle3, 0, 0,1) //angle is gama, this mean is on the Z axis > You're probably not getting alpha, beta and gamma angles correctly. But Euler angles are incredibly confusing anyways. Since the cylinder drawn by gluCylinder is initially oriented towards the Z axis, find out the crossproduct between that and the vector between the two sphere's centers. If it's zerolength, stop here, you've got the right orientation already. If not, then the vector resulting from the cross product is your axis of rotation. If the vector between the two spheres has been normalized before all this, then the length of the vector resulting from the crossproduct is the sinus of the angle between the Z axis and the vector between the two spheres (and thus the required angle of rotation). Do an arcsin on that, then do a single glRotate around that axis with the angle obtained. Tadah, no Euler angles, it works, no confusion nowhere. :) Unless I made a stupid mistake.  eric plante, software developer, effects, discreet 
From: Marcelo E. Magallon <marcelo.magallon@bi...>  20011010 13:27:09

>> Eric Plante <eric.plante@...> writes: > then the length of the vector resulting from the crossproduct is the > sinus of the angle between the Z axis and the vector between the two > spheres (and thus the required angle of rotation). Do an arcsin on > that, then do a single glRotate around that axis with the angle > obtained. It's probably not important in this case, but instead of computing asin(vector_product), from which OpenGL is going to compute sin and cos again, just build the rotation matrix yourself using the vector product (sine, as noted) and the dot product (cosine). Don't forget to normalize the vectors before starting. Look in the entry for glRotate in the reference guide if you need help with the rotation matrix.  Marcelo 
From: <rrogerio@cf...>  20011008 18:39:53

hi again, please answerme to this address rick = =20 jrodriguez@... = =20 e.gob.mx To: mesa3dusers@...= rceforge.net =20 cc: = =20 08/10/01 Subject: Re: [Mesa3dusers= ] I cant orienting a cylinder... =20 11:33 a.m. = =20 = =20 = =20 Hi guys, I sent this messages from another account, I didn't realize my= mistake if anybody answered me, please could resend me his answer,,, rick. jrodriguez@... e.gob.mx To: mesa3dusers@... cc: 05/10/01 Subject: Re: [Mesa3dusers= ] I cant orienting a cylinder... 01:27 p.m. Hi list, I have a trouble with glRotate, I want to connect two spheres with a cylinder, I already obtained the t= hree angles to rotate the cylinder for orienting it correctly, but when I dr= aw the cylinder the orientation is incorrect! I don=B4t know what happens! anybody could explainme how works glRotate? I have understood that I write: glRotate(angle, x, y, z) x, y, z are a vector on which I rotate the angle... I wrote: glRotate(angle1, 1, 0, 0) //angle is alfa, this mean is on the X axis glRotate(angle2, 0, 1, 0) //angle is beta, this mean is on the Y axis glRotate(angle3, 0, 0,1) //angle is gama, this mean is on the Z axis what I am doing wrong? Please helpme! rick _______________________________________________ Mesa3dusers mailing list Mesa3dusers@... https://lists.sourceforge.net/lists/listinfo/mesa3dusers _______________________________________________ Mesa3dusers mailing list Mesa3dusers@... https://lists.sourceforge.net/lists/listinfo/mesa3dusers = 
From: <rrogerio@cf...>  20011009 18:25:48

Hi list I know somebody answered me this messages, but he answered to another address, =B4cause I had a mistake, and I send it from another account := } Could he send me his answer again please? Sorry. rick = =20 jrodriguez@... = =20 e.gob.mx To: mesa3dusers@...= rceforge.net =20 cc: = =20 05/10/01 Subject: Re: [Mesa3dusers= ] I cant orienting a cylinder... =20 02:27 p.m. = =20 = =20 = =20 Hi list, I have a trouble with glRotate, I want to connect two spheres with a cylinder, I already obtained the t= hree angles to rotate the cylinder for orienting it correctly, but when I dr= aw the cylinder the orientation is incorrect! I don=B4t know what happens! anybody could explainme how works glRotate? I have understood that I write: glRotate(angle, x, y, z) x, y, z are a vector on which I rotate the angle... I wrote: glRotate(angle1, 1, 0, 0) //angle is alfa, this mean is on the X axis glRotate(angle2, 0, 1, 0) //angle is beta, this mean is on the Y axis glRotate(angle3, 0, 0,1) //angle is gama, this mean is on the Z axis what I am doing wrong? Please helpme! rick _______________________________________________ Mesa3dusers mailing list Mesa3dusers@... https://lists.sourceforge.net/lists/listinfo/mesa3dusers = 