Improve camera controls, and fix FOV, which was off by a factor of 2.

This commit is contained in:
daid 2015-02-25 16:09:48 +01:00
parent 0f65cf3cf1
commit 5a03928a4b

View file

@ -60,37 +60,10 @@ class PrinterApplication(QtApplication):
self.getRenderer().setBackgroundColor(QColor(200, 200, 200)) self.getRenderer().setBackgroundColor(QColor(200, 200, 200))
camera = Camera('3d', root) camera = Camera('3d', root)
camera.translate(Vector(0, 150, 150)) camera.translate(Vector(-150, 150, 300))
proj = Matrix()
proj.setPerspective(85, 640/480, 1, 500)
camera.setProjectionMatrix(proj)
camera.setPerspective(True) camera.setPerspective(True)
camera.lookAt(Vector(0, 0, 0), Vector(0, 1, 0)) 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') controller.getScene().setActiveCamera('3d')
self.setActiveMachine(self.getMachines()[0]) self.setActiveMachine(self.getMachines()[0])