ObjectContainer3D transform matrix not updating

Software: Away3D 3.x

lostirc, Newbie
Posted: 29 July 2011 06:48 PM   Total Posts: 5

Hello!

I’m trying to rotate an ObjectContainer3D by settings it’s transform property. For some reason when I set my container.transform it doesn’t update, though if I trace out the matrix it has changed.

Here is my code:

private function loop(e:Event):void {
   
var currentMousePoint:Point = new Point(view.mouseXview.mouseY);
   
   if (
rotateModel{
   
    
var difference:Point currentMousePoint.subtract(previousMousePoint);
    var 
vector:Number3D = new Number3D(difference.xdifference.y0);
    
    var 
rotationAxis:Number3D = new Number3D();
    
rotationAxis.cross(vectorFORWARD);
    
rotationAxis.normalize();
    
    
    var 
distance:Number Point.distance(currentMousePointpreviousMousePoint); //rotates based off DMouse
    
var rotMat:MatrixAway3D = new MatrixAway3D();
    
rotMat.rotationMatrix(rotationAxis.x, -rotationAxis.y0distance/150);

    var 
newMat:MatrixAway3D = new MatrixAway3D();
  
    
newMat.multiply3x3(rotMatcontainer.transform);
   
    
//for testing, not functional
    
var m:MatrixAway3D = new MatrixAway3D();
    
m.sxx = -1.02;
    
m.sxy = -1.02;
    
m.sxz = -1.02;
    
m.syx = -1.02
    
m.tz  = -1.02;
    
/////
    
    
    
container.transform.clone(newMat); //not updating even though the a trace of newMat AND container.transform shows updated values
    //container.transform = m; //THIS works and Updates
    
trace(container.transform);
    
    
previousMousePoint currentMousePoint;
  
   
}
   
  
   view
.render();
  

Now I have used similar code on some pv3d projects and it has worked. For some reason it doesn’t seem like away3d is updating my objects transform matrix. If I set the transform to m it does update

   

Somokon, Member
Posted: 29 July 2011 06:52 PM   Total Posts: 75   [ # 1 ]

Should it not be

container.transform newMat.clone() 

instead?

   

lostirc, Newbie
Posted: 29 July 2011 06:55 PM   Total Posts: 5   [ # 2 ]

clone takes a MatrixAway3D but I just did this:

container.transform newMat

and it works…. I really feel like I tried this before though ha

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X