How to set a matrix x angle to zero ?

Started by gamenewer, October 20, 2014, 11:19:10 AM

Previous topic - Next topic

gamenewer

Maybe this question is very simple,  but i  don't know how to do so , forgive me

EgonOlsen


gamenewer

#2
I get a matrix  from a vector , I only want to rotate my car by  Y and Z , so I must  set the X angle to 0 , but  I don't know how to set  x angle to 0

EgonOlsen

By setting the x-component of the vector to 0 in the first place?

gamenewer

Wow,  I perform an  lookat action,  I get the SimpleVector from a curve , and   get this SimpleVector matrix , then set the car by this matrix ,

                        SimpleVector posAhead = way.PointOnPath(xp);   
         SimpleVector poscur = getTransformedCenter();
         posAhead.sub(poscur);
         rotMatrix=posAhead.getRotationMatrix();

                        //here    must set  X angle to 0
                        ???? setXangle = 0 ???
                        //
                        setRotationMatrix(rotMatrix);

EgonOlsen


gamenewer

#6
if  I  set  posAhead.x=0  , the car will rotate  very strange  and not perform a lookat action,  So it's not right

EgonOlsen

My bad...i actually meant to 0 y, not x.

gamenewer

You are greate !    set Y  = 0  it's OK ! :)