Archived

This topic is now archived and is closed to further replies.

EbonySeraph

Direct3D and matricies.

Recommended Posts

I understand perfectly what each of the important matricies(projection, world, veiw) do, but I dont know exactly how they are stored in the matrix itself. If someone would plase be so kind and tell me what exactly is put into these matricies by row. I need something like "In a 4*4 world matrix the elements in the fist row represent...so and so.". If anyone answers this it would be greatly appreciated. I also have a feeling a lot of people are in my position. They know what the matricies do and know how to use them in code(limited) but dont know what the heck the numbers in the cells actually mean. "Ogun''s Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.

Share this post


Link to post
Share on other sites
hmmm where should i start.. probably you should check out dx8sdk
anyway, here goes

4x4 matrix can contains 4 equations. (if you know how to multiply matrices it will help you visualize alot) (im not expert in this, somebody might explain better than i am)

think about when you multiply a vector and a 4x4 matrix

|x,y,z,w| |11,12,13,14|
|21,22,23,24|
|31,32,33,34|
|41,42,43,44|

so when you multiply using dot product u get:

x'' = x*11+y*21+x*31+w*41
y'' = x*12+y*22+x*32+w*42
z'' = x*13+y*23+x*33+w*43
w'' = x*14+y*24+x*34+w*44

x'',y''... are the new coordinates after multiplication

eg translation matrix for instance..

and u know that the transformation formula is :
x'' = x+dx
y'' = y+dy
z'' = z+dz

if you convert into matrix form u will get:
|1,0,0,0|
|0,1,0,0|
|0,0,1,0|
|dx,dy,dz,1|

so basicly
u can visualize matrix like tHis:
|x,x,x,x|
|y,y,y,y|
|z,z,z,z,|
|w,w,w,w|

each equation is packed in column..

hope this help u abit

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Most of the elements in translation matrix isn''t used becoz e.g. we want only x''=x+dx so we ignore y and z element by putting zero
you can see that in m11 is 1 because we want x.

in View matrix all rows and columns are used...so it depends..

Share this post


Link to post
Share on other sites