Hi, I'm currently learning to use opengl and I am trying to get my sprite to rotate around it's center, at the moment it seems to be rotating around the top left corner doing a huge circle in(and out) of the screen.Question1: How can I get the sprite to rotate around it's center?

Also, I'm trying to get the sprite to rotate to face where the mouse is positioned. I did a bit of searching and found a solution to get the angle of 2 points, but It doesnt seem to be working very well...Question2: How can I get a sprite to follow(by rotating) the mouse position?

2)Assuming you're using OpenGL you need to convert that to degrees. Math.toDegrees(radianAngle);

EDIT: Your current code does not convert it to degrees. 360 degrees = 2 pi radians, not 1 pi. The *-1 also makes no sense.

Thanks, I think the second answer has worked, but if I do glTranslatef(x, y, 0) it moves the sprite to the edge of the screen, but the sprite should already be at x y....so I'm, not sure what I'm doing wrong:/rotation code:

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org