Simple navigation with Away3D

I just built a simple navigation system in Away3D with TweenMax to check out how to move the camera around with tweens and interact with 3D objects in Away3D. The scene is quite simple with a few basic primitives. You can zoom in and out on predefined locations (the cubes) and you zoom out again by clicking anywhere on the screen.

Here’s the result:

Source code: NavigationTest.as

I found out is that you can group all objects that are going to have the same behavior on event handling into an ObjectContainer3D which helped reduce some typing. I also needed to create a Plane as a background to be able to add an event listener for mouse down on background.

This test helped me understand quite much of how Away3D works, hope it helps you as well.

2 Comments

Robert  on August 20th, 2008

I just found your example on Away3d and read through your comment. Thanks for that and for providing the source code - always great to learn! And your sample is a nice little idea!

Anyway, even though I didn’t get through your source yet, I wonder about the line that you had to add a plane for the background listener. I assume (from clicking through your sample in the browser) that this would be the function to restore the navigation to its original position. Wouldn’t there a stage.addEventListener(MouseEvent.CLICK) be enough?

Clicking on the bg, when all menues are at their original positions, throughs an error message (#1009, the message is in German and way too much to translate). Is that a intended behaviour?

Again - thanks for your sample!
Any more tutorials or sample to come? Would be greatly appreciated - especially on light-material-camera-behaviour!

Robert

Harry Northover  on October 27th, 2008

This is very cool. I am using Away3d a lot in my experiments and projects. Its amazing how much you can learn by building a simple demo.

Cheers.
Harry.

Leave a Comment