Mercurial > hg > Game > Cerium
changeset 1051:2a291e6ac2fc draft
scale
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 09 Dec 2010 22:30:32 +0900 |
parents | 294bc9364bee |
children | a0ea7d9b6faf |
files | Renderer/Engine/matrix_calc.cc |
diffstat | 1 files changed, 19 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/matrix_calc.cc Thu Dec 09 21:55:09 2010 +0900 +++ b/Renderer/Engine/matrix_calc.cc Thu Dec 09 22:30:32 2010 +0900 @@ -169,17 +169,17 @@ float *m = stack? m1 : matrix; /* View Transform */ - m[0] = cosz*cosy+sinz*sinx*siny*scale[0]; - m[1] = sinz*cosx*scale[1]; - m[2] = -cosz*siny+sinz*sinx*cosy*scale[2]; + m[0] = cosz*cosy+sinz*sinx*siny; + m[1] = sinz*cosx; + m[2] = -cosz*siny+sinz*sinx*cosy; m[3] = 0; - m[4] = -sinz*cosy+cosz*sinx*siny*scale[0]; - m[5] = cosz*cosx*scale[1]; - m[6] = sinz*siny+cosz*sinx*cosy*scale[2]; + m[4] = -sinz*cosy+cosz*sinx*siny; + m[5] = cosz*cosx; + m[6] = sinz*siny+cosz*sinx*cosy; m[7] = 0; - m[8] = cosx*siny*scale[0]; - m[9] = -sinx*scale[1]; - m[10] = cosx*cosy*scale[2]; + m[8] = cosx*siny; + m[9] = -sinx; + m[10] = cosx*cosy; m[11] = 0; m[12] = txyz[0]; m[13] = txyz[1]; @@ -191,6 +191,16 @@ matrix4x4(matrix, m, stack); } + matrix[0] *= scale[0]; + matrix[1] *= scale[0]; + matrix[2] *= scale[0]; + matrix[4] *= scale[1]; + matrix[5] *= scale[1]; + matrix[6] *= scale[1]; + matrix[8] *= scale[2]; + matrix[9] *= scale[2]; + matrix[10] *= scale[2]; + } void rotate_x(float *xyz, float r)