Fixed the rotation pivot and added scalability

This commit is contained in:
Ziver Koc 2007-03-18 17:38:58 +00:00
parent f25b07910e
commit 01af69cbc8
5 changed files with 33 additions and 21 deletions

View file

@ -92,13 +92,16 @@ public class Sprite extends Entity {
GL11.glPushMatrix();
//Reset The Current Modelview Matrix
GL11.glLoadIdentity();
//Sets the scale of the sprite
super.setScaleGL();
//Sets the location
super.setTranslationGL();
//the rotation
super.setRotationGL();
//and sets back the rotation so that the rotation pivot is the center of the sprite
super.setTranslationGL(-texture.getImageWidth()/2,-texture.getImageHeight()/2);
//set rotation of the sprite
// And the rotation
setRotationGL();
//Set the location
setTranslationGL();
// bind to the appropriate texture for this sprite
texture.bindGL();
GL11.glColor3f(1,1,1);