From 76bc924f465a954e1f7105b328ad95606a0d222c Mon Sep 17 00:00:00 2001 From: Armin Burgmeier Date: Sun, 12 Jul 2009 19:06:31 +0200 Subject: [PATCH] Take zoom into account when rendering a mesh --- standard/src/StdGL.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/standard/src/StdGL.cpp b/standard/src/StdGL.cpp index 90d9ea48c..b4317baee 100644 --- a/standard/src/StdGL.cpp +++ b/standard/src/StdGL.cpp @@ -317,7 +317,14 @@ void CStdGL::PerformMesh(StdMeshInstance &instance, float tx, float ty, float tw //glEnable(GL_NORMALIZE); glEnable(GL_LIGHTING); - // TODO: Zoom, ClrMod, ... +/* float twdt = wdt; + float thgt = hgt;*/ + tx = (tx - ZoomX) * Zoom + ZoomX; + ty = (ty - ZoomY) * Zoom + ZoomY; + twdt *= Zoom; + thgt *= Zoom; + + // TODO: ClrMod, ... //glColor4f(1.0f, 1.0f, 1.0f, 0.0f); @@ -327,7 +334,7 @@ void CStdGL::PerformMesh(StdMeshInstance &instance, float tx, float ty, float tw glTranslatef(tx + rx*twdt, ty + ry*thgt, 0.0f); // Put a light source in front of the object - GLfloat light_position[] = { 0.0f, 0.0f, 15.0f, 1.0f }; + GLfloat light_position[] = { 0.0f, 0.0f, 15.0f*Zoom, 1.0f }; glLightfv(GL_LIGHT0, GL_POSITION, light_position); glEnable(GL_LIGHT0);