Page 1 of 1

Theoric question: matrix4

Posted: Sat Apr 26, 2008 8:43 am
by Tonyx
I was looking an irrlicht example code and i found: matrix4.

Is useful for .....? A vector in the space have 3 coordinates, why i must use a 4x4 matrix? The code is:

matrix4 mat;
mat.setRotationDegrees(rotation);
vector3df direction(1,0,0);
mat.rotateVect(direction);

where rotation is the Objectnode->getRotation().
What this code do?

Thx in advance.

Posted: Sat Apr 26, 2008 10:57 am
by JP
Matrices are used for transformations in 3D graphics, i suggest you read up on them if you want to learn how to do 3D graphics stuff!

What that code is doing is rotating the direction vector by the rotation of the Objectnode.

Posted: Sat Apr 26, 2008 1:27 pm
by MasterGod

Posted: Sat Apr 26, 2008 2:28 pm
by Tonyx
Thank you JP and Mastergod for your answers.

I'm reading tutorial on sacredsoftware.net really interesting. Thank you again.