from BigWorld import CursorCamera camera = CursorCamera() camera.fov = 60 camera.nearPlane = 0.1 camera.farPlane = 1000
from BigWorld import CursorCamera, Math camera = CursorCamera() def updateCamera(dt): mouseDelta = Math.Vector2(Mouse.dx, Mouse.dy) camera.update(mouseDelta, dt) BigWorld.addWatcher("update", updateCamera)
from BigWorld import CursorCamera, Math, Entity camera = CursorCamera() cube = Entity() cube.model = "models/cube.model" cube.position = Math.Vector3(-1, 0, -5) def update(dt): mouseDelta = Math.Vector2(Mouse.dx, Mouse.dy) camera.update(mouseDelta, dt) # set the camera position and orientation BigWorld.camera().set(camera.matrix) # render the cube BigWorld.renderWorld(dt) BigWorld.addWatcher("update", update)In this example, we create a new instance of the CursorCamera class and an instance of the Entity class which represents a cube in the 3D world. Inside the `update` function, we update the camera's position and orientation and then set the camera matrix as the active camera using the `BigWorld.camera` method. Finally, we render the scene using the `BigWorld.renderWorld` method.