From 65a8d8158e79a50993339c8162308ac62ee6ebc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Tue, 9 Feb 2010 23:47:00 +0100 Subject: verbesserungen --- DisplayClass.cpp | 71 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) (limited to 'DisplayClass.cpp') diff --git a/DisplayClass.cpp b/DisplayClass.cpp index 4051e20..872b730 100644 --- a/DisplayClass.cpp +++ b/DisplayClass.cpp @@ -61,44 +61,43 @@ void DisplayClass::renderScene(unsigned long delta, std::bitset<256>& keys) { void DisplayClass::keyhandler(std::bitset<256>& keys){ static float abstand = 0; if(keys.any()) { - glLoadIdentity(); - - static float rotm[16] = { - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1}; - char h = '2'; - if(keys.test(h)) - glRotatef(3, 1, 0, 0); - - h = '4'; - if(keys.test(h)) - glRotatef(-3, 0, 1, 0); - - h = '6'; - if(keys.test(h)) - glRotatef(3, 0, 1, 0); - - h = '8'; - if(keys.test(h)) - glRotatef(-3, 1, 0, 0); - - h = '+'; - if(keys.test(h)) - abstand -= 0.2; + glLoadIdentity(); + + static float rotm[16] = { + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1}; + char h = '2'; + if(keys.test(50)) + glRotatef(3, 1, 0, 0); + + h = '4'; + if(keys.test(52)) + glRotatef(-3, 0, 1, 0); + + h = '6'; + if(keys.test(54)) + glRotatef(3, 0, 1, 0); + + h = '8'; + if(keys.test(56)) + glRotatef(-3, 1, 0, 0); + + h = '+'; + if(keys.test(43)) + abstand -= 0.2; + + h = '-'; + if(keys.test(45)) + abstand += 0.2; - h = '-'; - if(keys.test(h)) - abstand += 0.2; + glMultMatrixf(rotm); + glGetFloatv(GL_MODELVIEW_MATRIX, rotm); - glMultMatrixf(rotm); - glGetFloatv(GL_MODELVIEW_MATRIX, rotm); - - glLoadIdentity(); - glTranslatef(0, 0, abstand); - glMultMatrixf(rotm); - + glLoadIdentity(); + glTranslatef(0, 0, abstand); + glMultMatrixf(rotm); // glutPostRedisplay(); } } -- cgit v1.2.3