Camera: projection_matrix

projection_matrix
  • Returns the camera's 4x4 projection matrix.

Return Type:
  • 4x4 matrix.
Sample Code

################## get the camera's projection matrix

# 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 matrix
matrix = cam.projection_matrix