SFML community forums

Help => General => Topic started by: Kojay on March 25, 2013, 12:42:43 am

Title: Flipping a polygon animation
Post by: Kojay on March 25, 2013, 12:42:43 am
Hello,

I wish to animate the flip of a polygon (say, reflect it across the y axis): I 'd like to show it "sticking out" of the screen as it is flipped. This borders on 3d, however I don't want to actually use opengl simply for this. On the other hand, the polygon may be freely rotated, so I cannot prepare still images for the animation.

Any pointers as to what would be the best approach/tools would be appreciated.
Title: Re: Flipping a polygon animation
Post by: eXpl0it3r on March 25, 2013, 02:09:18 am
Just use OpenGL and 3D. It's just not worth trying to create a pseudo 3D renderer and if you're in 3D you can place things directly as you want them to be.

If you don't think it's worth it, you might want to give more information on what you're doing. ;)
Title: Re: Flipping a polygon animation
Post by: Kojay on March 25, 2013, 04:19:41 pm
Thanks for reply. So far, nothing else in the program requires more than SFML offers.

The goal currently is to illustrate how permutations act on a polygon whose vertices are labelled 1,...,n. Here's a screenshot in fact:

https://dl.dropbox.com/u/105214643/aan_pic.jpg

Rotations are easy, but I 'd like the reflections to be a little bit more animated than an instant flip. I suppose I might go for opengl anyway, in preparation of displaying polyhedra too. Any other ideas would still be welcome though.
Title: Re: Flipping a polygon animation
Post by: Laurent on March 25, 2013, 04:31:23 pm
Quote
I wish to animate the flip of a polygon (say, reflect it across the y axis)
In 2D, thus viewed from the top, this animation has no perspective, so it's easy to fake with a 2D API. All you have to do is to animate the X scale factor from 1 to -1.
Title: Re: Flipping a polygon animation
Post by: Kojay on April 03, 2013, 09:06:56 am
Thanks. Isn't this the same as so called orthographic projection? Probably looks convincing enough anyway.
Title: Re: Flipping a polygon animation
Post by: Laurent on April 03, 2013, 09:25:10 am
Quote
Isn't this the same as so called orthographic projection?
Yes.