diff options
author | Constantin Riß <constantin.riss@dre.de> | 2010-02-09 23:47:00 +0100 |
---|---|---|
committer | Constantin Riß <constantin.riss@dre.de> | 2010-02-09 23:47:00 +0100 |
commit | 65a8d8158e79a50993339c8162308ac62ee6ebc4 (patch) | |
tree | 1932c07b1fc7d795b5b87b3f1f4e798fba338983 /DisplayClass.cpp | |
parent | a0882cb30bd754a25625dfbeb831877bf0ab9ccd (diff) | |
download | c3d-65a8d8158e79a50993339c8162308ac62ee6ebc4.tar c3d-65a8d8158e79a50993339c8162308ac62ee6ebc4.zip |
verbesserungen
Diffstat (limited to 'DisplayClass.cpp')
-rw-r--r-- | DisplayClass.cpp | 71 |
1 files changed, 35 insertions, 36 deletions
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(); } } |