What is a Matrix Identity ??

Started by
7 comments, last by mdias 21 years, 4 months ago
Hi, I''ve been doing a 3d engine and I never knew what a Matrix Identity is. Never used it, and I''ve had no problems at all with matrixes. What I want to know is what a Matrix Identity is needed for and what it is. Thanx in advance to all who post. KaMiKaZe
Advertisement
An Identity Matrix is a matrix that doesn''t do anything. Any vectors or vertices that are put into the matrix come out of it unchanged. It''s like multiplying something with 1.
More specifically, an identity matrix is a matrix with 1's in its left diagonal which has no "effect" on (i.e. it doesn't change the value of any element of) a matrix by which it is multiplied.

This is an example of a 3x3 identity matrix:
[1 0 0]
[0 1 0]
[0 0 1]

If you work through the multiplication of the above matrix with another compatible matrix, you'll notice that the resulting matrix is congruent to the original.

My speculation : multiplication by an identity matrix is commutative.

edit The above example shows a "multiplicative identity" matrix. There is also an "additive identity" matrix, which as inference will tell you is all 0's.

Additionally, this has a little more on identity matrices and other types of matrices.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links


[edited by - zealouselixir on December 15, 2002 2:17:54 PM]

[twitter]warrenm[/twitter]

then what''s the point? err.. when would that be useful?
Let''s say that your graphics pipeline used matrices to represent transformations (e.g. rotations and translations). In order to transform a point, it would be necessary to multiply a point (1x3 matrix) by your transformation matrix. This multiplication would always take place, whether you were actually performing a tranformation or not. In the case that you wanted the point to not move (i.e. remain constant through multiplication by the transformation matrix), you would set the transformation matrix to the identity matrix.

According to C. Hecker, it''s also used to assist in solving certain linear algebra problems, but I have no experience with that

Peace,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[twitter]warrenm[/twitter]

In arithmetic, there are 2 identity numbers:

0 is the additive identity: x + 0 = x
1 is the multiplicative identity. x * 1 = x


In matrix math, there are 2 identity matrixes (each square matrix has one)

the additive identity is

  [0 0]        given any matrix [A],   [A] + [0 0] = [A][0 0]                                      [0 0]  


the multiplicative identity is

  [1 0]        given any matrix [A],   [A] x [1 0] = [A][0 1]                                      [0 1]  


Note, that multiplicative in the sense of matrices refers to matrix multiplication, not scalar multiplication. Also, the multiplicative identity, when larger matrices are used (3x3 or 4x4 when using 3D transformation matrices), it is just all 0''s with a diagonal line of 1''s going down the center.

As for what it is useful for.... I''m not sure how Direct3D uses matrices (I''m an OpenGL guy, but I''m gonna get some books on D3D for Xmas =-), but in OpenGL at least, though, you need to reset the MODELVIEW matrix every frame to the identity matrix before you can start applying other transformations to the scene. This makes it so all your transformations start from the center of the world looking down the Z axis (or from your D3D perspective, looking UP the Z axis). If you don''t reset the MODELVIEW matrix, you end up stacking your transformations ON TOP of the ones you had in place last frame! Basically that means your camera could be anywhere! The identity matrix gives us a place to start each frame fresh and clean.

However, again, I''m not sure how this is done in D3D. You may not have to worry about it or you may have a command that does this for you (in OpenGL, you just call glLoadIdentity() ). However, other than resetting your view each frame, it doesn''t have any other real use, so don''t worry about it too much.

"You TK''ed my chicken!"
So, an Identity Matrix as an origin of rotations and translations
right ?
If we want to rotate an object around a 3D point we use Identity
Matrixes ?
Is that it ?

KaMiKaZe
No... the Identity Matrix is a matrix that does NOTHING. As the others said, it''s like multiplying by 1... it doesn''t change the result. That can be used if you want an object that is NOT transformed. That is, an object at your world''s origin, oriented on the 3 axis... not rotated... anything. Since you HAVE TO specify world, view and projection matrices, when you don''t want to use them, you have to use the identity.

Clearly:
If you want to rotate, you use rotation matrix.
If you want to translate, you use a translation matrix.
If you want to scale, you use a scale matrix.
If you want to project, you use projection matrix.
If you don''t want to do anything... you use identity.

______________________________
Oooh, you found the horadric cube!
Editor42 ...builds worlds
Okay, thanx to all that posted

KaMiKaZe

This topic is closed to new replies.

Advertisement