[SOLVED] Rotating Slick-Util Textures

Before I post a n00b question on here, I make sure to google it in many forms. Everywhere I look, this is the output:

glRotated(angle, 0, 0, 0);

Now the javadoc says that the parameters are “double angle, double x, double y, double z” respectively. Issue is, all the above code does is warp the image’s size.

glRotated(angle, 0, 0, 1);

rotates the image, but, rotates the layer it was drawn upon as well, meaning that it moves it’s position on the screen, which does not bode very well for my specific game.

glRotated(angle, x, y, 0/*or 1*/);

this warps the image so that it implodes with the angle going larger.

How can I make it so that the image rotates like the second code example, but stay in the same place?

I don’t know OpenGL or Slick, but it seems like the x/y are the origin to rotate around, and so when you set it as (0, 0) you are rotating around bottom left. To calculate the origin (you probably already know) just take the image x + (imageWidth / 2), and image y + (imageHeight / 2).

x, y, z is the axis. So you generally will just put (0, 0, 1) if you want to rotate around the z axis.

See here:
http://badlogicgames.com/forum/viewtopic.php?p=36999#p36999

Alright, so the angle and the z-coords are the only ones that need editing considering I am doing a 2D game, so how would I stop it from rotating in a fixed radius around the origin, and have it stay on the origin whilst rotating, or being able to set the radius it rotates around the origin?

EDIT: That tutorial told me how to translate the position properly, so all is good :smiley: