autodesk viewCube

Software: Away3D 4.x

YG, Newbie
Posted: 01 December 2011 11:26 PM   Total Posts: 18

hello,
i in a middle of building a viewer in away3d 4 for viewing models and you can in the viewer control over the models texture and they are also animated models.

anyway,
i want to have in my viewer a “viewCube” for rotating a camera around the object like in the new autodesk 3d software’s.

now i want that the “viewCube” will be always stick in the right top corner of the view, and will not affect from the camera perspective projection.

how can i do that?
is there a way to give an object a different perspective projection from the sene?

and also it will need to be always over the others objects in the scene.

it’s need it’s own view, but the problem is that if i give him it’s own view
it will have a static background.

can you point me to a direction how to achieve that?
thanks!

 

 

 

   

John Brookes, Moderator
Posted: 03 December 2011 02:17 PM   Total Posts: 732   [ # 1 ]

Here follows useless info wink

I tried the exact same a few monnths ago.
Tried the obviuos two views, but as you say the background cant be transparent.

So had the theory to try and skew the matrix, but the way the matrix updates (I think thats the reason) its not possible.

eg this doesnt work (defualt camera/view and cube)

var m:Matrix3D =new  Matrix3D(Vector.<Number>([1,0,0,0,0,1,0,0,0.5,0,1,0,500,0,0,1]));   
var 
cm:Matrix3D cube.transform.clone();
m.append(cm);
cube.transform m

So the other theory was try and change the cameras matrix when its applied to the cubes matrix
So I did a little test and tried

Again default camera/view and a cube (called dave)
entity.as

public function pushModelViewProjection(camera Camera3D) : void
{
 
if (++_mvpIndex == _stackLen{
  _mvpTransformStack[_mvpIndex] 
= new Matrix3D();
  
_stackLen++;
 
}
 
 
var mvp Matrix3D _mvpTransformStack[_mvpIndex];
 
mvp.copyFrom(sceneTransform);
 if (
this.name == "dave")
 
{
  mvp
.append(new Matrix3D(Vector.<Number>([0.9607469439506531,0,0,0,0,1.7320507764816284,0,0,0.7,0,1.0020040273666382,1,800,0,981.9639282226563,1000])));
 
}
 
else
 
{
 
 mvp
.append(camera.renderToTextureProjection);
 
 
}
 mvp
.copyColumnTo(3_pos);
 
_zIndices[_mvpIndex] = -_pos.z;


Which is horrid but sort of worked.
And thats as far as I played with it.

   

YG, Newbie
Posted: 04 December 2011 02:35 AM   Total Posts: 18   [ # 2 ]

thanks, i love your solution!!!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X