Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

mesa3d-users

 Re: [Mesa3d-users] I cant orienting a cylinder... From: - 2001-10-08 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=
 Re: [Mesa3d-users] I cant orienting a cylinder... From: - 2001-10-08 17:21:32 Hi guys, I sent this messages from another account, I didn't realize my= mistake if anybody answered me, please could re-send me his answer,,, rick. = =20 jrodriguez@... = =20 e.gob.mx To: mesa3d-users@...= rceforge.net =20 cc: = =20 05/10/01 Subject: Re: [Mesa3d-users= ] 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 _______________________________________________ Mesa3d-users mailing list Mesa3d-users@... https://lists.sourceforge.net/lists/listinfo/mesa3d-users =
 Re: [Mesa3d-users] I cant orienting a cylinder... From: Eric Plante - 2001-10-09 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 cross-product between that and the vector between the two sphere's centers. If it's zero-length, 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 cross-product 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. Ta-dah, no Euler angles, it works, no confusion nowhere. :) Unless I made a stupid mistake. -- eric plante, software developer, effects, discreet
 Re: [Mesa3d-users] I cant orienting a cylinder... From: Marcelo E. Magallon - 2001-10-10 13:27:09 >> Eric Plante writes: > then the length of the vector resulting from the cross-product 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
 Re: [Mesa3d-users] I cant orienting a cylinder... From: - 2001-10-08 18:39:53 hi again, please answerme to this address rick = =20 jrodriguez@... = =20 e.gob.mx To: mesa3d-users@...= rceforge.net =20 cc: = =20 08/10/01 Subject: Re: [Mesa3d-users= ] 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 re-send me his answer,,, rick. jrodriguez@... e.gob.mx To: mesa3d-users@... cc: 05/10/01 Subject: Re: [Mesa3d-users= ] 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 _______________________________________________ Mesa3d-users mailing list Mesa3d-users@... https://lists.sourceforge.net/lists/listinfo/mesa3d-users _______________________________________________ Mesa3d-users mailing list Mesa3d-users@... https://lists.sourceforge.net/lists/listinfo/mesa3d-users =
 Re: [Mesa3d-users] I cant orienting a cylinder... From: - 2001-10-09 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: mesa3d-users@...= rceforge.net =20 cc: = =20 05/10/01 Subject: Re: [Mesa3d-users= ] 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 _______________________________________________ Mesa3d-users mailing list Mesa3d-users@... https://lists.sourceforge.net/lists/listinfo/mesa3d-users =