When I want to move object around point I do:
point.x *= cosf(timer.timeElapsed);
point.y *= sinf(timer.timeElapsed);
How to make point move on eight or infinity sign trajectory?
|
When I want to move object around point I do:
How to make point move on eight or infinity sign trajectory? |
|||
|
|
|
|
|||
|
|
|
As Marton notes, there are several "figure of eight" curves that might fit your needs. Perhaps the simplest is the lemniscate of Gerono, which has the parametrization:
and looks like this:
However, the lemniscate of Bernoulli may be visually more pleasing; it has a parametrization very similar to the lemniscate of Gerono, except that both axes are scaled by a factor of
It looks like this:
(Animations made with Maple 13, compressed with GIFsicle.) |
|||||||||||
|