mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 23:29:07 +08:00
Fix the cameras etc of the default setup
This commit is contained in:
parent
35a67b6d25
commit
4572c7a9b7
@ -25,38 +25,46 @@ class PrinterApplication(QtApplication):
|
||||
mesh.setMeshData(self.getMeshFileHandler().read(Resources.getMesh("ultimaker2_platform.stl"), self.getStorageDevice('local')))
|
||||
|
||||
mesh2 = SceneNode(mesh)
|
||||
mesh2.setMeshData(self.getMeshFileHandler().read(Resources.getMesh("sphere.obj"), self.getStorageDevice('local')))
|
||||
mesh2.translate(Vector(0, 50, 0))
|
||||
mesh2.scale(20)
|
||||
mesh2.setMeshData(self.getMeshFileHandler().read(Resources.getMesh("simplecube.stl"), self.getStorageDevice('local')))
|
||||
mesh2.translate(Vector(30, 30, 0))
|
||||
mesh2.scale(10)
|
||||
|
||||
mesh3 = SceneNode(mesh)
|
||||
mesh3.setMeshData(self.getMeshFileHandler().read(Resources.getMesh("sphere.obj"), self.getStorageDevice('local')))
|
||||
mesh3.translate(Vector(0, 0, 0))
|
||||
|
||||
self.getRenderer().setLightPosition(Vector(0, 150, 150))
|
||||
|
||||
camera = Camera('3d', root)
|
||||
camera.translate(Vector(0, 150, 150))
|
||||
proj = Matrix()
|
||||
proj.setOrtho(-200, 200, -200, 200, -500, 500)
|
||||
proj.setPerspective(45, 640/480, 1, 500)
|
||||
camera.setProjectionMatrix(proj)
|
||||
camera.rotateByAngleAxis(-45, Vector(1, 0, 0))
|
||||
camera.setPerspective(True)
|
||||
camera.lookAt(Vector(0, 0, 0), Vector(0, 1, 0))
|
||||
|
||||
camera = Camera('left', root)
|
||||
camera.translate(Vector(150, 0, 0))
|
||||
camera.rotateByAngleAxis(-90, Vector(0, 1, 0))
|
||||
camera.translate(Vector(150, 50, 0))
|
||||
proj = Matrix()
|
||||
proj.setOrtho(-200, 200, -200, 200, -500, 500)
|
||||
proj.setOrtho(-200, 200, -200, 200, 1, 500)
|
||||
camera.setProjectionMatrix(proj)
|
||||
camera.lookAt(Vector(0, 0, 0), Vector(0, 1, 0))
|
||||
camera.setLocked(True)
|
||||
|
||||
camera = Camera('top', root)
|
||||
camera.translate(Vector(0, 150, 0))
|
||||
camera.rotateByAngleAxis(-90, Vector(1, 0, 0))
|
||||
proj = Matrix()
|
||||
proj.setOrtho(-200, 200, -200, 200, -500, 500)
|
||||
proj.setOrtho(-200, 200, -200, 200, 1, 500)
|
||||
camera.setProjectionMatrix(proj)
|
||||
camera.lookAt(Vector(0, 0, 0), Vector(0, 1, 0))
|
||||
camera.setLocked(True)
|
||||
|
||||
camera = Camera('front', root)
|
||||
camera.translate(Vector(0, 0, 150))
|
||||
camera.translate(Vector(0, 50, 150))
|
||||
proj = Matrix()
|
||||
proj.setOrtho(-200, 200, -200, 200, -500, 500)
|
||||
proj.setOrtho(-200, 200, -200, 200, 1, 500)
|
||||
camera.setProjectionMatrix(proj)
|
||||
camera.lookAt(Vector(0, 0, 0), Vector(0, 1, 0))
|
||||
camera.setLocked(True)
|
||||
|
||||
self.getController().getScene().setActiveCamera('3d')
|
||||
|
Loading…
x
Reference in New Issue
Block a user