Question

The best example of what I am trying to achieve is on this youtube video

http://www.youtube.com/watch?v=53Tk-oGL2Uo

The letters that make up the word 'Atari' fly in from the edges of the screen spinning and then line up to make the word at the end.

I know how to make an object move across the screen, but how do I calculate the spinning so that when the object gets to its end position it's facing the correct direction?

Was it helpful?

Solution

The trick is to actually have the object(s) in the right position for a specific time (say t=5.0 seconds) and then calculate backwards for the previous frames.

i.e. before 5.0 seconds you rotate the object(s) by [angular velocity] * (5.0 - t) and translate by [velocity] * (5.0 - t)

If you do this, then it will look like the objects fly together and line up perfectly. But what you've actually done is blown them apart in random directions and played the animation backwards in time :-)

OTHER TIPS

The CORRECT way of doing this is using keyframes. You can create the keyframes in any 3D editor (I use MAX, but you could use Blender). You don't necessarily need to use the actual characters, even a cuboid would suffice. You will then need to export those animation frames (again, in MAX I would use ASE - COLLADA would work with Blender) and either load them up at runtime or transform them to code.

Then it's a simple matter of running that animation based on the current time.

Here's a sample from my own library that illustrates this technique. Doing this once will last you far longer and give you more benefits in the long run than figuring out how to do this procedurally.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top