I've never had much problem rotating things in OpenGL but I've been away from my redbook for a while.
Some time ago I made a crude primatives library. The call draws a shape around point (0,0,0).
I wanted to simply draw a cyllindar rotated along the z axis 90 degrees.
Instead, if I use glloadidentity() nothing is drawn, if I leave it out the shape just spins like mad. I really hate to post here for such a simple question. I've looked around a bit first and I know that usually you call loadidentity,translate and then rotate in that order.
Strict
Include "shapes.bmx" ' my old primatives library
GLGraphics 800, 600
glEnable(GL_DEPTH_TEST)
glShadeModel(GL_FLAT)
glOrtho(0, 800, 600, 0, 1000, - 1000)
glClearColor(.25, .25, .25, 1)
While Not KeyDown(KEY_ESCAPE)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glTranslatef(400.0, 300.0, 0.0)
glRotatef(90.0, 0.0, 0.0, 1.0)
draw_tube(36.0, 1.0, 480.0, 200.0, 1.0)
Flip
Wend