Cameras from 3dsmax

Software: Away3D 4.x

Embalmer, Newbie
Posted: 15 January 2013 10:02 AM   Total Posts: 6

Hi Everyone,

I need to create a 360° rotation tool to show all sides of a building. In fact; the building rotation is only a simulation because I only display HD pictures rendered with 3dsmax according to the mouse position.
However I have to display some interractive wired shapes over certain parts of the building so I tried export camera’s coordinates, rotation and fov from 3dsmax to recreate them into away 3d (and draw a simple cube with the same coordinates as the interractive shapes).
It seems there are problems because I can’t see the cube. I’m completly lost,  is it a unit problem ? I use milimeters in my 3dsmax file but I’m not shure what kind of unit away3d uses. Should I use another way to do it ??

Here is my method to setup my camera :

protected function setupCamera(x:Numbery:Numberz:Numberrx:Numberry:Numberrz:Numberzoom:Numberfov:Number{
    away3DView
.view.camera.position = new Vector3D(x,y,z);
    
away3DView.view.camera.rotationX rx;
    
away3DView.view.camera.rotationY ry;
    
away3DView.view.camera.rotationZ rz;
    
away3DView.view.camera.lens = new PerspectiveLens(fov);
   

 
I use : Away3D 4.1 and Starling (to display the static background) on Flex 4.6


Thx

   

Avatar
loth, Sr. Member
Posted: 15 January 2013 06:08 PM   Total Posts: 236   [ # 1 ]

hello look my tutorial for good unit
http://3dflashlo.wordpress.com/awd-accuracy/

 

   

Embalmer, Newbie
Posted: 16 January 2013 01:51 PM   Total Posts: 6   [ # 2 ]

Thanks loth for your tutorial. Unfortunatly, after modifying the units to “generic” it doesn’t solve my problem.

Here’s a more detailed explanation of my problem and my goal.

The attached pictures show my 3dsmax scene and how I get the box and camera coordinates


After taking all these measures and put it in my flex application :

// Creation of the box
box = new Mesh(new CubeGeometry(331.05236.268283), new SkyBoxMaterial(bct));
box.position = new Vector3D(4961.3, -6453.70);
away3DView.view.scene.addChild(box);



 protected function 
setupCamera(x:Numbery:Numberz:Numberrx:Numberry:Numberrz:Numberzoom:Numberfov:NumberupdateContollers:Boolean=true{
  away3DView
.view.camera.position = new Vector3D(x,y,z);
  
//away3DView.view.camera.lookAt(box.position);
  //away3DView.view.camera.lookAt(new Vector3D(4983.4,-6559.2,70.0)); // camera target
  
away3DView.view.camera.lens = new PerspectiveLens(fov);
  
away3DView.view.camera.rotateTo(rx,ry,rz);
  
  
trace("camera rotation "+away3DView.view.camera.rotationX+";"+away3DView.view.camera.rotationY+";"+away3DView.view.camera.rotationZ);
  
trace("camera position "+away3DView.view.camera.x+";"+away3DView.view.camera.y+";"+away3DView.view.camera.z);
  
away3DView.view.render(); 

 

   

Embalmer, Newbie
Posted: 16 January 2013 01:56 PM   Total Posts: 6   [ # 3 ]

And here’s the results (of my previous post), no cube at all (the building is a static bitmap background) (look attached file)


If I replace

away3DView.view.camera.rotateTo(rx,ry,rz); 

By :

away3DView.view.camera.lookAt(box.position);


the results is the same, I have to increase the size of the box to see a piece of result :

for example :

box = new Mesh(new CubeGeometry(600, 600, 600), new SkyBoxMaterial(bct));

And the results is a cut cube with a weird rotation (look attached file).

 

Could you help me, because I totally lost;


Thx.

 

   

Avatar
loth, Sr. Member
Posted: 16 January 2013 02:25 PM   Total Posts: 236   [ # 4 ]

juste to be sure
3dsmax is Z up axis and away3d is Y up axis
for good fov in away3d you have to test different lens i have not formule

i look more closely you result

 

   

Embalmer, Newbie
Posted: 16 January 2013 03:49 PM   Total Posts: 6   [ # 5 ]

Thks loth, I’ll look that way.
I also understood why my box was cut, it’s because of the far property of my camera.

I simply put a higher value to correct it (so I put the original box size back).

away3DView.view.camera.lens.far 10000

You can see the result in the attached file.

Don’t pay attention to the material, which used a BitmapCubeTexture with a box which is no longer a cube wink

 

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X