def flushRendering(self): new = QEntity() self.view.setRootEntity(new) camController = QFirstPersonCameraController(new) self.scene = new self.createScene() camController.setLinearSpeed(500.0) camController.setLookSpeed(180.0) camController.setCamera(self.camera)
def initialiseCamera(self, view): # Camera. self.camera = view.camera() self.camera.lens().setPerspectiveProjection(45.0, 16.0 / 9.0, 0.1, 1000000.0) self.camera.setPosition(QVector3D(100, 100, 100)) self.camera.setViewCenter(QVector3D(0.0, 0.0, 0.0)) # For camera controls. camController = QFirstPersonCameraController(self.scene) camController.setLinearSpeed(500.0) camController.setLookSpeed(300.0) camController.setCamera(self.camera)