Rotation Problem

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Rotation Problem

Post by chili » October 27th, 2012, 3:37 am

If you want to rotate a raster sprite, then I'm afraid it's just as LuX said earlier. If you take every pixel, translate it so that it's position is now relative to your point of rotation, rotate it with the sin/cos transformation, translate the point again to get to screen coordinates, and plot it, you will get a sprite. However, it will look like utter garbage and there will be holes in it.

In order to do rotation nicely, you have to do a special (and simpler) case of texturing. I will be covering this after we finish the platformer game.
Chili

moobywotsit
Posts: 3
Joined: January 29th, 2013, 7:15 pm

Re: Rotation Problem

Post by moobywotsit » January 30th, 2013, 8:59 pm

How would I go about rotating a square? haha

Musi
Posts: 106
Joined: November 25th, 2012, 1:06 am

Re: Rotation Problem

Post by Musi » January 31st, 2013, 7:03 am

Are you using the DrawLine() finction to draw between four points? Cause that's a lot easier than a bitmap.
Musi

There are 10 types of people that understand binary.
Those that do, and those that don't.

Post Reply