View Full Version : Mad rotation problem

01-05-2002, 11:03 PM
I've got this weird rotation problem and I'm wondering if theres some kind of limitation in Open GL to call GL rendering code from a custom Model class. I've loaded a 3DS file (via a loader class) into vertex arrays in a model class (TModel). I'm then rendering the model from an Open GL skeleton (included in the CBuilder Example code so I know it works) The model renders fine but it won't rotate at all (using glRotatef). The original skeleton has rotation code that works with its models but even if I just comment out its modelling code and replace it with my Model class Render method and leave the original rotation code intact it still doesn't work. My Render method simply runs through the arrays rendering each point (glVertex3f) between glBegin and glEnd statements and the buffer is flushed and swapped back in the GL skeleton after the method call. Could it perhaps be a SwapBuffer issue? Has anyone else run into similar problems? Any help will be greatly appreciated as I've been struggling with this for days *sigh*

01-07-2002, 01:41 PM
i had something simular before, and it turned out to be that i was pushing to many matrices onto the modelview matrix stack. (i had simply got 1 more push command than pop command and so in effect i had a stack leak http://www.opengl.org/discussion_boards/ubb/frown.gif ).

I hope that may help

01-08-2002, 04:48 AM
Well I moved the Rendering code out of the class as is and into the GL Skeleton and everything started working proper. Whats strange is that the rendering worked fine from the class just not the rotation. Even when I rotated from the skeleton before the Class Render method it still wouldn't work *scratches head*