Page 2 of 4

Re: Sprite shearing to fake rotation

Posted: Mon Jan 07, 2013 8:39 pm
by tepples
If you're moving only 8-pixel-wide strips, as in the example, you can move bytes at a time, or you can just move the sprites.

Re: Sprite shearing to fake rotation

Posted: Mon Jan 07, 2013 9:18 pm
by psycopathicteen
tepples wrote: or you can just move the sprites.
Shearing in both x and y directions at the same time are smoother than just shearing in one direction.

Re: Sprite shearing to fake rotation

Posted: Sat Feb 23, 2013 10:04 pm
by tepples
I'm developing a video game in Python that I plan to port to the NES once all the physics and gameplay elements are in place. I've implemented shearing of 8-pixel-wide strips into its graphics engine to simulate shifting 8x8 pixel sprites on the NES. The sprite sheet stores 8 frames of rotation through a half circle; these flip to 16 and shear to 48. The end result almost cannot be distinguished from hardware matrix rotation like that of the GBA.

Play video (103 kB)
(Should play in Chrome, Firefox, Opera, and VLC)

Re: Sprite shearing to fake rotation

Posted: Mon Feb 25, 2013 3:10 pm
by Bananmos
Wow, that looks really awesome! Highly innovative way to get so smooth rotation-animation and I can't wait to see the full game! :)

One suggestion though is that you probably should spend some more frames of animation on that turning box, because the smoother the overall animation is, the more distracting it is when it suddenly goes jerky...

Re: Sprite shearing to fake rotation

Posted: Thu Mar 14, 2013 3:19 pm
by tepples
Shearing on the boxes would look like this.

Re: Sprite shearing to fake rotation

Posted: Thu Mar 14, 2013 5:05 pm
by Sik
Yeah, I guess the only reasonable solution would be to double the amount of frames the animation has ^^;

Re: Sprite shearing to fake rotation

Posted: Thu Mar 14, 2013 5:32 pm
by rainwarrior
Shearing on the boxes looks fine to me. The only thing I don't like about the boxes is the light pixels on the bottom edges in the 2nd/4th frames.

Re: Sprite shearing to fake rotation

Posted: Thu Mar 14, 2013 8:44 pm
by tepples
Sik wrote:Yeah, I guess the only reasonable solution would be to double the amount of frames the animation has ^^;
I tried that, and it didn't look quite as smooth as shearing. But I'll make sure to remove the failed attempt to antialias, as rainwarrior suggested.

Re: Sprite shearing to fake rotation

Posted: Thu Mar 14, 2013 10:14 pm
by Sik
The problem is that in the example you provided the jumps between different sprites is still way too noticeable to look smooth. If it spins faster it probably wouldn't matter much, but at that speed it's still too obvious.

Re: Sprite shearing to fake rotation

Posted: Thu Mar 14, 2013 11:39 pm
by tokumaru
It looks like the box is made of Jell-O.

Re: Sprite shearing to fake rotation

Posted: Fri Mar 15, 2013 1:30 am
by Gilbert
One problem I see about the current box animation is that the original upright sprite has dithering and the sheared sprites look really really unpolished, thus a glaring dive in image quality when it starts rotating (but at 45 degree the sprite suddenly looks good again, which IMO looks even better than the upright one), so I think it's wiser to design the sprites without those "checkbox dithering", or else you may hand edit each sheared sprites to make them look better.

Re: Sprite shearing to fake rotation

Posted: Fri Mar 15, 2013 6:04 am
by tokumaru
Gilbert wrote:but at 45 degree the sprite suddenly looks good again, which IMO looks even better than the upright one
Really? I think the upright one looks much nicer than the 45 degree one (which looks kinda generic), but no matter which one you like better the fact that they are radically different from each other make the animation less believable.

Re: Sprite shearing to fake rotation

Posted: Fri Mar 15, 2013 11:42 am
by Bregalad
It looks interesting, but it'd be better to the eye if the center of the rotation was the center of the block itself instead of being below it.

Now I'm thinking what kind of games the rotation would be actually useful...

Re: Sprite shearing to fake rotation

Posted: Fri Mar 15, 2013 11:47 am
by Sik
Gilbert wrote:One problem I see about the current box animation is that the original upright sprite has dithering and the sheared sprites look really really unpolished, thus a glaring dive in image quality when it starts rotating (but at 45 degree the sprite suddenly looks good again, which IMO looks even better than the upright one), so I think it's wiser to design the sprites without those "checkbox dithering", or else you may hand edit each sheared sprites to make them look better.
Eh, in motion the dithering doesn't look as bad (probably because it's constantly changing).

Re: Sprite shearing to fake rotation

Posted: Fri Mar 15, 2013 3:53 pm
by tokumaru
Bregalad wrote:it'd be better to the eye if the center of the rotation was the center of the block itself instead of being below it.
Have you played or watched a video of the game where this is used? These are boxes that a (disturbingly legless) person pushes around, so they have to be animated like that.