Matrix rotation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
KakCAT
Posts: 10
Joined: Fri May 14, 2010 10:09 am

Matrix rotation

Post by KakCAT »

Hi!

I seem to fail to see the function in the API, because it's obvious it's there.

I have a CMatrix4, which I makeIdentity();

I want to rotate this matrix around the Y axis a certain angle alpha, i.e. having

Code: Select all

1 0 0 0 
0 1 0 0
0 0 1 0

I'd like to get

Code: Select all

ca  0  sa 0
0   1  0  0
-sa 0  ca 0
ca=cos alpha
sa=sin alpha

(I hope I haven't messed the rotation matrix ;) )

Thanks,
Kak
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

setRotationRadians(0,a,0) should do this.
KakCAT
Posts: 10
Joined: Fri May 14, 2010 10:09 am

Post by KakCAT »

hybrid wrote:setRotationRadians(0,a,0) should do this.
thanks! I expected something like function (normalized vector, angle), I suppose that's why I discarded this function despite I saw it was probably the correct one
Post Reply