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

Creating advanced spherical surface transitions with Quaternions

There are scenarios when you want to move an object on top of a surface of geometry according to the mouse coordinates. Initially, the task is quite simple if we deal with plain surfaces. But once you would like to do such a movement on top of spherical objects, things get much more complicated. If you attempt to tween your (let's call it) satellite, assigning it just the coordinates derived from the surface mouse click point, you will see that if the transition distance is large, your satellite will go through the sphere mesh on its path to the destination coordinates. The solution is a spherical movement or spherical interpolation (SLERP), which can be achieved using Quaternion. ...

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