Say I have a 64x64 image. I want to rotate that image to the right by 45.0 degrees (x?), and slant it backwards by 15.0 degrees (z?).
How does glRotatef work? (an example would be nice)
Should I use glPushMatrix and glPopMatrix to get back to the unrotated state?
EDIT:
I can rotate it to the right.. but how do I tilt it back? (z = x?)
How can I retain the original position of the tile?
How does glRotatef work? (an example would be nice)
Should I use glPushMatrix and glPopMatrix to get back to the unrotated state?
EDIT:
I can rotate it to the right.. but how do I tilt it back? (z = x?)
How can I retain the original position of the tile?
SuperStrict Framework brl.glmax2d Import brl.pngloader SetGraphicsDriver GLMax2DDriver() Graphics 800,600,0 Global w:Float, h:Float Global tex:Int = LoadTexture("tile.PNG") glTexParameteri GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR glTexParameteri GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR glLoadIdentity glEnable GL_TEXTURE_2D Local mx:Float = 200, my:Float = 200 While Not KeyHit(KEY_ESCAPE) 'mx = MouseX(); my = MouseY() Cls glLoadIdentity glBindTexture GL_TEXTURE_2D, tex glShadeModel(GL_SMOOTH) If KeyDown(KEY_SPACE) glRotatef(45.0, 0.0, 0.0, 1.0) 'glTranslatef(0.0, my, mx) End If 'Draw the texture glBegin GL_QUADS glTexCoord2f 0.0, 0.0; glVertex2f mx, my glTexCoord2f 1.0, 0.0; glVertex2f mx + w, my glTexCoord2f 1.0, 1.0; glVertex2f mx + w, my + h glTexCoord2f 0.0, 1.0; glVertex2f mx, my + h glEnd Flip Delay 10 Wend End Function LoadTexture:Int(url:Object) Local pm:TPixmap, id:Int pm = LoadPixmap(url) w = pm.width; h = pm.height' / 2 id = GLTexFromPixmap(pm) Return id End Function