Facing towards the mouse
Posted: Sun Oct 23, 2005 5:46 am
Ive got a ship, with 16 animations of it rotating around, full 360. I looked at the demo for the Moon Defender and figured out to make it rotate in the direction towards the mouse, but my problem is its backwards. If I point the mouse up the ship is facing down. So, how would I fix that? Here is the code
- Code: Select all
double mouseangle = direction(xscreen, yscreen, xmouse, ymouse);
animpos = (mouseangle/360.0)*(nframes);