On Wed, Apr 21, 2010 at 9:21 PM, Alejandro Castellanos < [email protected]> wrote:
> The problem was, or seems to still be, that now I can only keep > rotating around the Z axis, but not around any other axis. It's kinda > odd. As I understood it, you have to first create a polygon around an > axis, and then rotate it (which I don't seem to be doing right). Now > the triangle does rotate around the Z axis, but it gets 'slashed' > again if I try to rotate around any other axis. > > And now I'm throroughly confused since as I've seen in tutorials I've > seen it defined as this: > > void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); > > But I'm having to use glRotatef(rtri, 0.0, 0.0, 1.0); which, yet > again, rotates around the Z axis but 'slashes' the figure if I attempt > to rotate around X or Y. > I think you have a fundamental misunderstanding of the Rotate function. The first argument to glRotatef represents the angle through which to rotate, and the remaining three arguments represent the axis about which to rotate, as a three-dimensional vector. The function can only provide a rotation about a single axis. If you need to rotate around multiple axes, you must chain together calls to glRotatef. For instance, to rotate first about the Z-axis, and subsequently about the X-axis (which was previously the Y-axis): glRotatef( 90.0, 0.0, 0.0, 1.0 ); glRotatef( 45.0, 1.0, 0.0, 0.0 ); -- Tristam MacDonald http://swiftcoder.wordpress.com/ -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
