Rotations and Origins
- by Theodore Enderby
I was hoping someone could explain to me, or help me understand, the math behind rotations and origins.
I'm working on a little top down space sim and I can rotate my ship just how I want it.
Now, when I get my blasters going it'd be nice if they shared the same rotation.
Here's a picture.
and here's some code!
blast.X = ship.X+5;
blast.Y = ship.Y;
blast.RotationAngle = ship.RotationAngle;
blast.Origin = new Vector2(ship.Origin.X,ship.Origin.Y);
I add five so the sprite adds up when facing right.
I tried adding five to the blast origin but no go.
Any help is much appreciated