PaperVision 3D Cubes Experiment

May 26th, 2009 · 2 Comments

I spent my Memorial Day evening setting up a PaperVision 3D project to serve as a demo for a customer and I just so happened to save the project as I was getting the basics implemented.  I thought it would make a perfect blog post for those just getting started with PV3D.

The project covers moving the camera around in 3D space (including focusing in on objects) as well as object distribution including in a straight (horizontal) line and random distribution in 3D space (more screenshots after the jump).

There are two classes in this file, the first (called CustomCube) extends the PaperVision Cube class.  This is very basic, the only custom code in here creates random colors for each face and sets a random X/Y position.  The other class, which does all the heavy lifting, extends BasicView and includes an ArrayCollection to keep track of references to the CustomCube classes.  This class has built in functions to move the camera and distribute CustomCube objects in 3D space.

I’m using the Tweener Libraries to move the camera and cubes.

Check it out below, source code included.

View the Project in Action
View the Source Code

Papervision 3D Random Cubes Screenshot

PaperVision 3D Cubes Zoomed In

Tags: ActionScript · Flex · PaperVision 3D