|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| 3D Matrix Math Demystified |
|
![]() YoYo Member since: 3/14/2001 From: Dallas, USA |
||||
|
|
||||
| This helped me figure something out tonight. When I was done reading it... I realized who wrote it. Thanks Seumas |
||||
|
||||
![]() sparkster Member since: 2/12/2004 From: USA |
||||
|
|
||||
| isn't the final block of code wrong? the code for multiplying 2 matrixes? here's the code from the article:
for(i = 0; i < 3; i++){ //Cycle through each vector of first matrix.
NewMatrix[i][0] = MatrixA[i][0] * MatrixB[0][0] +
MatrixA[i][1] * MatrixB[1][0] + MatrixA[i][2] * MatrixB[2][0];
NewMatrix[i][1] = MatrixA[i][0] * MatrixB[0][1] +
MatrixA[i][1] * MatrixB[1][1] + MatrixA[i][2] * MatrixB[2][1];
NewMatrix[i][2] = MatrixA[i][0] * MatrixB[0][2] +
MatrixA[i][1] * MatrixB[1][2] + MatrixA[i][2] * MatrixB[2][2];
}
here's how I think it should look: (correct me if I'm wrong)
for(i = 0; i < 3; i++){ //Cycle through each vector of first matrix.
NewMatrix[0][i] = MatrixA[0][i] * MatrixB[0][0] +
MatrixA[1][i] * MatrixB[0][1] +
MatrixA[2][i] * MatrixB[0][2];
NewMatrix[1][i] = MatrixA[0][i] * MatrixB[1][0] +
MatrixA[1][i] * MatrixB[1][1] +
MatrixA[2][i] * MatrixB[1][2];
NewMatrix[2][i] = MatrixA[0][i] * MatrixB[2][0] +
MatrixA[1][i] * MatrixB[2][1] +
MatrixA[2][i] * MatrixB[2][2];
}
Otherwise the article is very interesting. |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Very nice, was really helpfull to me. I especially enjoied the non-mathematical, simple but clear way of explaining things. I think 3D graphics really needs more guides like this one. |
||||
|
||||
![]() Holland Member since: 1/28/2008 |
||||
|
|
||||
| I had a firm grasp of matrix and vector math before this, but this is definitely the best written approach to matrices I've seen, text book or otherwise. And believe me, I have a LOT of books on the subject. Well done! I will definitely book mark this and recommend it to others. |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|