In this recipe, you will learn how to add basic interactivity to an Away3D primitive that is rotated according to Mouse movements on the screen. Although this feature is far from being rocket science, it is not uncommon to see an incorrect implementation of it in many applications which results in quite unnatural or imperfect behavior of interacted objects.
Set up a new Away3D scene extending our
AwayTemplate class and you are ready to go.
In the next program, we create a typical Away3D sphere primitive. Our goal is to rotate the sphere around its x- and y- axis according to the mouse's x and y direction movement on the stage: