MeshHelper.applyPosition doesn’t work

Software: Away3D 4.x

aeki, Member
Posted: 16 March 2013 08:07 PM   Total Posts: 73

On both Away3D 4.1 and Away3D 4.0.9

Am I doing it wrong or is it a bug?

myCube = new Mesh(new CubeGeometry(10,10,10), new ColorMaterial);
view3D.scene.addChild(myCube);

view3D.stage.addEventListener(MouseEvent.DOUBLE_CLICK,onMouse2Click);

protected function 
onMouse2Click(event:MouseEvent):void
{
 trace
('onMouse2Click');
 
MeshHelper.applyPosition(myCube,0,0,-50);
   

myCube Mesh doesn’t move, always at (0,0,0)

   

Avatar
Fabrice Closier, Administrator
Posted: 16 March 2013 09:25 PM   Total Posts: 1265   [ # 1 ]

applyPosition, similar in concept to applyRotation, does offset at objectspace level. The result is invisible on screen.
But if you would rotate after applyPosition, you could see that the pivot has changed. if you want to move as in your example, simply do myCube.z += somevalue or myCube.position = someVector3D;

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X