Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jan

Pages: [1]
1
Graphics / Re: Sprite rotation
« on: September 21, 2012, 04:01:27 pm »
Smoothing worked like a charm, thanks!  :)

I will try the shape api later, but I'm afraid that the fake 3d effect, which i have in my png's, will be hard to recreate.

Jan

2
Graphics / Sprite rotation
« on: September 21, 2012, 01:58:46 pm »
Hi,

for my top-down, tile-based 2d game, I have a png (16x16) with a circle and a small line (something like this: o- ) representing the player. The line pointing out of the circle is pointing to the direction the player is walking. At this moment i just rotate the sprite according to the player's walking direction (if player is walking from (0,0) to (10,10) i rotate 45 degrees). The rotation angle can be any float between 0 and 360 degrees. I noticed that if the sprite is rotated around an angle which is not a multiple of 90 degrees, the result looks really bad. I was wondering how the rotation works? Is every pixel just rotated (which probably results in rounding errors which explain the bad results), or is there a smarter algorithm behind (eg rotating corners + scanline algorithm)?

And more general: i have 2 zooming levels. Is it a good idea to make the sprites in high res (eg 256x256) and let the scaling do it's work, or is it better to have a 16x16 and 32x32 png file for each object? Or is it even better to use the sfml shape api to draw the simple shapes (after all, it's just a circle and a line)?
Thanks for the help

Jan

Pages: [1]