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

## Re: [PyOpenGL-Users] Re: [PyOpenGL-Devel] rotation problem

 Re: [PyOpenGL-Users] Re: [PyOpenGL-Devel] rotation problem From: Rene Dudfield - 2003-11-17 12:06:05 ```You can do this, and it is a tiny insy bit quicker than push/pop too, but may be prone to small float errors if you do it lots. a = 30. x,y,z = 1., 0., 0. # rotate to your place in the gl universe. glRotatef(a, x,y,z) something_rotated() # rotate back glRotatef(a,-x,-y,-z) You can get the current matrix with glLoadMatrix(...) but not the transformed coordinates. Well it is possible with shaders, with a bit of effort. Have fun! http://www.holepit.com/ ```

 [PyOpenGL-Users] Re: [PyOpenGL-Devel] rotation problem From: Mike C. Fletcher - 2003-11-15 09:41:30 ```You'll want to push and pop a matrix stack to do rotation. You can find demo code for glPushMatrix linked here: http://pyopengl.sourceforge.net/documentation/manual/glPushMatrix.3G.xml BTW, most OpenGL tutorials, such as the red book or NeHe will cover matrix-stack manipulations. HTH, Mike Drishti Integra wrote: > hi, > > i am a newbee to pyopengl. > would be very kind if any one can guide me for the following: > > i am trying to rotate a few objects using glRotate(). but this seems > to rotate the whole coordinates system as well as any lightings i have > used. is there a way to rotate only objects and not the coordinate > system and lights. > > thanks and regards _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ ```
 [PyOpenGL-Users] Re: [PyOpenGL-Devel] rotation problem From: - 2003-11-17 08:33:58 Attachments: Message as HTML ```hi, thanks a lot for help! i tried using the glPushMatrix() and glPopMatrix() as suggested by the examples, but the coordinate system still seems to rotate. like when i rotate at initial position along x and y the rotation seems to be proper, but now after doing so if i rotate along z then my z axis seems to have changed ... giving a feeling that the coordiante system has changed? also is there a way to get the updated coordinates of the rotated object? regards "Mike C. Fletcher" wrote: You'll want to push and pop a matrix stack to do rotation. You can find demo code for glPushMatrix linked here: http://pyopengl.sourceforge.net/documentation/manual/glPushMatrix.3G.xml BTW, most OpenGL tutorials, such as the red book or NeHe will cover matrix-stack manipulations. HTH, Mike Drishti Integra wrote: > hi, > > i am a newbee to pyopengl. > would be very kind if any one can guide me for the following: > > i am trying to rotate a few objects using glRotate(). but this seems > to rotate the whole coordinates system as well as any lightings i have > used. is there a way to rotate only objects and not the coordinate > system and lights. > > thanks and regards _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now.```
 Re: [PyOpenGL-Users] Re: [PyOpenGL-Devel] rotation problem From: Rene Dudfield - 2003-11-17 12:06:05 ```You can do this, and it is a tiny insy bit quicker than push/pop too, but may be prone to small float errors if you do it lots. a = 30. x,y,z = 1., 0., 0. # rotate to your place in the gl universe. glRotatef(a, x,y,z) something_rotated() # rotate back glRotatef(a,-x,-y,-z) You can get the current matrix with glLoadMatrix(...) but not the transformed coordinates. Well it is possible with shaders, with a bit of effort. Have fun! http://www.holepit.com/ ```