Here's some code snippets:
private function initCamera() : void
{
camera = new Camera3D({zoom:4, focus:100, x:0, y:35,
z:-75});
camera.lens = new PerspectiveLens();
clipping = new FrustumClipping();
}// initCamera
private function initDummy() : void
{
dummy = new Sphere({material:"white", radius:10,
segmentsH:10,
segmentsW:5, ownCanvas:true});
dummy.position = camera.position;
}// initDummy
private function initHook() : void
{
hook = Collada.load("../assets/models/hook.dae").handle;
hook.scaleX = hook.scaleY = hook.scaleZ = .009;
hook.y = 35;
hook.x = camera.x;
hook.z = camera.z + 75;
hookContainer = new ObjectContainer3D(hook);
hookContainer.movePivot(camera.x, hookContainer.y,
camera.z);
hookContainer.addChild(dummy);
view.scene.addChild(hookContainer);
}// initHook
private function updateCamera() : void
{
// handling zoom
if (keyDown["s"])
hookContainer.moveBackward(5);
if (keyDown["w"])
hookContainer.moveForward(5);
// handling turning
if (keyDown["a"])
hookContainer.yaw(-1.5);
if (keyDown["d"])
hookContainer.yaw(1.5);
camera.transform = dummy.sceneTransform;
}// updateCamera
And for the sake of reference, the SWF as it exists at this moment in
time:
http://jaydomagala.com/A3DPolyTest.swf
W: forward
S: backward
A: turn left
D: turn right