Hi thank you
It now works almost, with this code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| public static void firkant(){ movefirkant(); } public static void movefirkant(){ GL11.glPushMatrix(); GL11.glTranslatef(200.0f,400.0f,0.0f); GL11.glRotatef(firkantz,0.0f,0.0f,1.0f); renderfirkant(); GL11.glPopMatrix(); } public static void renderfirkant(){ GL11.glBegin(GL11.GL_QUADS); GL11.glVertex3f(0.0f, 0.0f, 0.0f); GL11.glVertex3f(40.0f, 0.0f, 0.0f); GL11.glVertex3f(40.0f, 40.0f, 0.0f); GL11.glVertex3f(0.0f, 40.0f, 0.0f); GL11.glEnd(); } |
It rotates the quad around the first vertex wherever
i put it on the screen but still not around the center of the quad. Maybe its because the quad isnt placed around 0.0? its to the right of 0.0
When moving a model should you change the drawing coordinates in renderfirkant() or move it with
the glTranslatef method?
I also tried to place the renderfirkant() call after the
movefirkant call in firkant() but that didnt work.