O'Reilly logo

Away3D 3.6 Cookbook by Michael Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Moving an object on top of the geometry with FaceLink

You may have a scenario where you wish to animate the position of one object on top of the surface of another. The Away3D FaceLink class, located in the away3d.animators package, serves that goal. FaceLink calculates for you the average coordinates of three vertices of each face and lets you tween your object from one face position to another in a sequential manner as well as to offset that position by demand.

In the next example, we will create a utility which allows us to adjust the position of a sapper relative to the Spy's mesh. This way, instead of guessing manually where Spy hand vertices are located, we run through all of them, animating the position of the sapper until it comes to the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required