### Author Topic: How to set a matrix x angle to zero ?  (Read 831 times)

• long
• Posts: 171
##### How to set a matrix x angle to zero ?
« 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

#### EgonOlsen

• Posts: 11747
##### Re: How to set a matrix x angle to zero ?
« Reply #1 on: October 20, 2014, 11:23:55 am »
I don't get the question...

• long
• Posts: 171
##### Re: How to set a matrix x angle to zero ?
« Reply #2 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
« Last Edit: October 20, 2014, 11:50:23 am by gamenewer »

#### EgonOlsen

• Posts: 11747
##### Re: How to set a matrix x angle to zero ?
« Reply #3 on: October 20, 2014, 12:25:51 pm »
By setting the x-component of the vector to 0 in the first place?

• long
• Posts: 171
##### Re: How to set a matrix x angle to zero ?
« Reply #4 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 poscur = getTransformedCenter();

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

#### EgonOlsen

• Posts: 11747
##### Re: How to set a matrix x angle to zero ?
« Reply #5 on: October 20, 2014, 02:06:43 pm »

• long
• Posts: 171
##### Re: How to set a matrix x angle to zero ?
« Reply #6 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
« Last Edit: October 20, 2014, 02:15:53 pm by gamenewer »

#### EgonOlsen

• Posts: 11747
##### Re: How to set a matrix x angle to zero ?
« Reply #7 on: October 20, 2014, 02:25:02 pm »
My bad...i actually meant to 0 y, not x.