def __init__(self, name=None): SensorCreator.__init__(self, name) self.camera = Camera("CameraRobot") self.camera.name = "CameraRobot" self.append(self.camera) self.properties(cam_width = 256, cam_height = 256, cam_focal = 35.0, capturing = True, Vertical_Flip = True) # set the frequency to 20 Hz self.frequency(20) # add toggle capture action (`Space` key) bpymorse.add_sensor(type="KEYBOARD") obj = bpymorse.get_context_object() sensor = obj.game.sensors[-1] sensor.key = 'SPACE' bpymorse.add_controller(type='LOGIC_AND') controller = obj.game.controllers[-1] bpymorse.add_actuator(type='PROPERTY') actuator = obj.game.actuators[-1] actuator.mode = 'TOGGLE' actuator.property = 'capturing' controller.link(sensor = sensor, actuator = actuator) # looking in +X SensorCreator.rotate(self, x=math.pi/2, z=math.pi/2) # append CameraMesh with its textures self.append_meshes(['CameraMesh'], "camera") self.rotate(z=math.pi)
def __init__(self, name=None): SensorCreator.__init__(self, name) self.camera = Camera("CameraRobot") self.camera.name = "CameraRobot" self.append(self.camera) self.properties(cam_width = 256, cam_height = 256, cam_focal = 35.0, capturing = True, Vertical_Flip = True) # set the frequency to 20 Hz self.frequency(20) # add toggle capture action (`Space` key) bpymorse.add_sensor(type="KEYBOARD") obj = bpymorse.get_context_object() sensor = obj.game.sensors[-1] sensor.key = 'SPACE' bpymorse.add_controller(type='LOGIC_AND') controller = obj.game.controllers[-1] bpymorse.add_actuator(type='PROPERTY') actuator = obj.game.actuators[-1] actuator.mode = 'TOGGLE' actuator.property = 'capturing' controller.link(sensor = sensor, actuator = actuator) # looking in +X SensorCreator.rotate(self, x=math.pi/2, z=math.pi/2) # append CameraMesh with its textures self.mesh = self.append_meshes(['CameraMesh'], "camera")[0] self.rotate(z=math.pi)
def rotate(self, x=0, y=0, z=0): SensorCreator.rotate(self, x=y, y=z, z=x)
def rotate(self, x=0, y=0, z=0): SensorCreator.rotate(self, x=y, y=z, z=x)