Sprite rotation

Posted by Kipras on Game Development See other posts from Game Development or by Kipras
Published on 2013-10-23T16:40:20Z Indexed on 2013/10/23 22:07 UTC
Read the original article Hit count: 210

Filed under:
|
|
|

I'm using OpenGL and people suggest using glRotate for sprite rotation, but I find that strange. My problem with it is that it rotates the whole matrix, which sort of screws up all my collision detection and so on and so forth. Imagine I had a sprite at position (100, 100) and in position (100, 200) is an obstacle and the sprite's facing it. I rotate the sprite away from the obstacle and when move upwards my y axis, even though the projection shows like it's going away from the obstacle, the sprite will intersect it. So I don't see another way of a rotating a sprite and not screwing up all collision detection other than doing mathematical operations on the image itself. Am I right or am I missing something?

© Game Development or respective owner

Related posts about opengl

Related posts about sprites