From 8693fd830680355d0633d6a4b681386832183b0d Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Mon, 21 Jan 2019 19:42:19 +0100 Subject: Implemented rotate angle is stored seperately, original vectors stay untouched. the resulting vectors are calculated in write() with applyRotation() to avoid growing rounding errors --- main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 531071e..991ea63 100644 --- a/main.cpp +++ b/main.cpp @@ -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); -- cgit v1.2.3