From 5a03928a4b3ae1505f48eabefa04d2701cbda21a Mon Sep 17 00:00:00 2001 From: daid Date: Wed, 25 Feb 2015 16:09:48 +0100 Subject: [PATCH] Improve camera controls, and fix FOV, which was off by a factor of 2. --- PrinterApplication.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/PrinterApplication.py b/PrinterApplication.py index f29730b397..382bc7d0f6 100644 --- a/PrinterApplication.py +++ b/PrinterApplication.py @@ -60,37 +60,10 @@ class PrinterApplication(QtApplication): self.getRenderer().setBackgroundColor(QColor(200, 200, 200)) camera = Camera('3d', root) - camera.translate(Vector(0, 150, 150)) - proj = Matrix() - proj.setPerspective(85, 640/480, 1, 500) - camera.setProjectionMatrix(proj) + camera.translate(Vector(-150, 150, 300)) camera.setPerspective(True) camera.lookAt(Vector(0, 0, 0), Vector(0, 1, 0)) - camera = Camera('left', root) - camera.translate(Vector(-150, 50, 0)) - proj = Matrix() - proj.setOrtho(-200, 200, -200, 200, 1, 500) - camera.setProjectionMatrix(proj) - camera.lookAt(Vector(0, 50, 0), Vector(0, 1, 0)) - camera.setLocked(True) - - camera = Camera('top', root) - camera.translate(Vector(0, 150, 0)) - proj = Matrix() - proj.setOrtho(-200, 200, -200, 200, 1, 500) - camera.setProjectionMatrix(proj) - camera.lookAt(Vector(0, 0, 0), Vector(0, 0, -1)) - camera.setLocked(True) - - camera = Camera('front', root) - camera.translate(Vector(0, 50, 150)) - proj = Matrix() - proj.setOrtho(-200, 200, -200, 200, 1, 500) - camera.setProjectionMatrix(proj) - camera.lookAt(Vector(0, 50, 0), Vector(0, 1, 0)) - camera.setLocked(True) - controller.getScene().setActiveCamera('3d') self.setActiveMachine(self.getMachines()[0])