Camera: world_to_camera

world_to_camera
  • Returns the world to camera transform

Return Type:
  • 4X4 Matrix
Sample Code

################## get the world to camera transform
  

# import bge
import bge

# get current scene
scene = bge.logic.getCurrentScene()

# get a list of the cameras
camList = scene.cameras

# get camera
# my camera is named security_cam

cam = camList["security_cam"]

# get transform
transform = cam.world_to_camera