www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: gamenewer on October 20, 2014, 11:19:10 am

Title: How to set a matrix x angle to zero ?
Post by: gamenewer on October 20, 2014, 11:19:10 am
Maybe this question is very simple,  but i  don't know how to do so , forgive me
Title: Re: How to set a matrix x angle to zero ?
Post by: EgonOlsen on October 20, 2014, 11:23:55 am
I don't get the question... ???
Title: Re: How to set a matrix x angle to zero ?
Post by: gamenewer on October 20, 2014, 11:41:19 am
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
Title: Re: How to set a matrix x angle to zero ?
Post by: EgonOlsen on October 20, 2014, 12:25:51 pm
By setting the x-component of the vector to 0 in the first place?
Title: Re: How to set a matrix x angle to zero ?
Post by: gamenewer on October 20, 2014, 01:57:06 pm
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);
Title: Re: How to set a matrix x angle to zero ?
Post by: EgonOlsen on October 20, 2014, 02:06:43 pm
posAhead.x=0!?
Title: Re: How to set a matrix x angle to zero ?
Post by: gamenewer on October 20, 2014, 02:09:13 pm
if  I  set  posAhead.x=0  , the car will rotate  very strange  and not perform a lookat action,  So it's not right
Title: Re: How to set a matrix x angle to zero ?
Post by: EgonOlsen on October 20, 2014, 02:25:02 pm
My bad...i actually meant to 0 y, not x.
Title: Re: How to set a matrix x angle to zero ?
Post by: gamenewer on October 20, 2014, 02:33:20 pm
You are greate !    set Y  = 0  it's OK ! :)