diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-01-21 19:42:19 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-01-21 19:42:19 +0100 |
commit | 8693fd830680355d0633d6a4b681386832183b0d (patch) | |
tree | bd6cf0f2c08ac2072519c3781c1d1d7a7261eded /main.cpp | |
parent | b8aa898b1f3182d028a67c39d8643b331c565053 (diff) | |
download | termgl-8693fd830680355d0633d6a4b681386832183b0d.tar.gz |
Implemented rotate
angle is stored seperately, original vectors stay untouched. the
resulting vectors are calculated in write() with applyRotation() to
avoid growing rounding errors
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -91,16 +91,22 @@ int main() switch(ie.c) { case 'w': - position.z++; + obj.rotate({-10,0,0}); break; case 's': - position.z--; + obj.rotate({10,0,0}); break; case 'a': - obj.scale(1.2); + obj.rotate({0,-10,0}); break; case 'd': - obj.scale(0.8); + obj.rotate({0,10,0}); + break; + case 'q': + obj.rotate({0,0,-10}); + break; + case 'e': + obj.rotate({0,0,10}); break; }; obj.setPosition(position); |