Theoric question: matrix4

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
Tonyx
Posts: 14
Joined: Fri Mar 11, 2005 5:13 pm

Theoric question: matrix4

Post 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.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Tonyx
Posts: 14
Joined: Fri Mar 11, 2005 5:13 pm

Post by Tonyx »

Thank you JP and Mastergod for your answers.

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