Papervision3D: Camera Orbiting Done 3 Ways - AutoOrbit [AS3] · Dec 26, 12:46 PM
In an attempt to come up with the perfect camera orbit, I’ve created these three classes. The goal was for them to be easy to use, add minimal overhead, and provide some useful options.
Each class requires a BasicView and a cameraTarget (a DisplayObject3D). All the classes share some similar options, however the mouseEnabled property in AuotoOrbitDrag behaves differently than the same property in the other two classes.
AutoOrbit (method 1)
When the mouse is at the left/right side of the viewport, orbit to minYaw/maxYaw.
When the mouse is at the top/bottom of the viewport, orbit to minPitch/maxPitch.
Import:
import com.afw.papervision3d.view.AutoOrbit;
Instantiate:
var orbitor:AutoOrbit = new AutoOrbit(myBasicView, myCameraTarget);
Then add this line to some sort of onRenderTick or enterFrame handler:
orbitor.update();
AutoOrbitTweenLite (method 2)
This one is the same as AutoOrbit, except it uses TweenLite. The result is very similar AutoOrbit.
Import:
import com.afw.papervision3d.view.AutoOrbitTweenLite;
Instantiate:
var orbitor:AutoOrbitTweenLite = new AutoOrbitTweenLite (myBasicView, myCameraTarget);
Then add this line to some sort of onRenderTick or enterFrame handler:
orbitor.update();
AutoOrbitDrag (method 3)
This class adds MOUSE_DOWN and MOUSE_UP listeners and only orbits when the user drags the mouse.
Import:
import com.afw.papervision3d.view.AutoOrbitDrag;
Instantiate:
var orbitor:AutoOrbitDrag = new AutoOrbitDrag(myBasicView, myCameraTarget);
Then add this line to some sort of onRenderTick or enterFrame handler:
orbitor.update();
— Pickle
Comment
New AFW/PV3D Microsite Launched MinimalRemoting: Simple Remoting Class without the Bells and Whistles [AS3]

When using this class with latest rev of Papervision3d (from svn)
I get the following error.
AutoOrbit.as:104: 1061: Call to a possibly undefined method orbit through a reference with static type org.papervision3d.core.proto:CameraObject3D.
I am using method 1.
Thanks
— Rohan Rehman · Jan 20, 10:34 AM · #
Royah, I just updated to to the latest rev and CameraObject3D in trunk still has the orbit function, while CS4 branch does not. Sounds like you are using the CS4 branch. Make sure you use the trunk.
— Pickle · Jan 20, 09:18 PM · #
Cheers for this. Just spent a hour to get my code working and the AutoOrbitDrag took 2 minutes. Great work. Thanks heaps.
— Chris · Aug 30, 12:18 AM · #