Discussion:
Creating a plane from the faces of a cube
Francis Altomare
2010-09-28 16:54:05 UTC
Permalink
Hello,
My end goal here is to create a set of 6 planes that will hover above each
face of a cube. Each face should have the same width/height and transform as
the cube but will be placed higher then its respective face.

Currently I'm trying to create a plane and have it take the transform matrix
of the cube thats already on screen. The code looks like this:

var dp:DisplayObject3D = new DisplayObject3D();
var testPlane:Plane = new Plane(movieMat,100,100)

var
currentRotationMatrix:org.papervision3d.core.math.Matrix3D = new
org.papervision3d.core.math.Matrix3D();

dp.addChild(testPlane);

scene.addChild(dp);
currentRotationMatrix = cubeHolder.transform;
trace(currentRotationMatrix);
dp.transform = currentRotationMatrix
trace(dp.transform);

Cube holder is a DisplayObject3D that hols the cube and has the
transofmration applied to it
I'm tracing out the rotation matrix before and after I apply the cube's
transform and both values are the same
The issue is when I set dp.transform = currentRotationMatrix the cube
rotates to what looks like front view, I think maybe the viewport is
changing?

Does anyone have another way for creating a plane that will have the same
size and transform as a face on a cube?

-thanks,
--
Francis Altomare,
Loading...