diff --git a/glslUtil/glslUtil.c b/glslUtil/glslUtil.c index 959b93a..d36f07e 100644 --- a/glslUtil/glslUtil.c +++ b/glslUtil/glslUtil.c @@ -46,6 +46,18 @@ void guMatrixTranslate(guMatrix4x4 *m, float x, float y, float z) } } +void guMatrixScale(guMatrix4x4 *m, float x, float y, float z) +{ + int i; + for (i = 0; i < 4; i++) + { + float *base = &(*m)[i][0]; + base[0] *= x; + base[1] *= y; + base[2] *= z; + } +} + void guMatrixFrustum(guMatrix4x4 *m, float left, float right, float bottom, float top, diff --git a/glslUtil/glslUtil.h b/glslUtil/glslUtil.h index d976f16..93653cf 100644 --- a/glslUtil/glslUtil.h +++ b/glslUtil/glslUtil.h @@ -17,6 +17,7 @@ extern "C" { void guMatrixLoadIdentity(guMatrix4x4 *m); void guMatrixMult(guMatrix4x4 *m, guMatrix4x4 *a, guMatrix4x4 *b); void guMatrixTranslate(guMatrix4x4 *m, float x, float y, float z); +void guMatrixScale(guMatrix4x4 *m, float x, float y, float z); void guMatrixFrustum(guMatrix4x4 *m, float left, float right, float bottom, float top,