您的位置:首页 > 其它

游戏开发中的数学和物理算法(18):缩放

2009-01-21 21:41 573 查看
2D[b]缩放的数学形式:[/b]

3D缩放

Matrix4X1 scale3DByMultiply(Matrix4X1 start, float dx, float dy, float dz)

{

Matrix4X4 temp;

Matrix4X1 result;

//Zero out the matrix to make sure nothing is left uninitialized.

temp = createFixed4X4Matrix(0);

//setup the 3x3 for multiplication;

temp.index[0][0] = dx;

temp.index[1][1] = dy;

temp.index[2][2] = dz;

temp.index[3][3] = 1;

result = multiplyMatrixNxM(temp,start);

return result;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: