Advertisement

matrix help needed

Started by September 06, 2000 05:38 PM
1 comment, last by ZebMacahan 24 years, 4 months ago
Hi everyone... If you have a matrix that rotated about x-axis and one about y and one about z and you wanted to rotate the points that made up your 3d world, this will prob. work but.... for (k=0; k<Nr_Of_Points; k++) { point[k] = MulPoint(Xmatrix, point[k]); point[k] = MulPoint(Ymatrix, point[k]); point[k] = MulPoint(Zmatrix, point[k]); } Anyone got any ideas how to improve the above code? I'll be thankful for any tips... /Zeb P.s For some reason the for loop gets kind of messed up when I post it here...hope u understand anyway... Edited by - ZebMacahan on 9/6/00 5:46:33 PM Edited by - ZebMacahan on 9/6/00 5:47:56 PM
Multiply all three matrices together:

matFinal = matX * matY * matZ;

then

for(...)
{
point[k]=MulPoint(finalMat,point[k]);
}


Cheers
Advertisement
thx, a lot...why didn''t I think of that...

This topic is closed to new replies.

Advertisement