Camera: perspective

perspective
  • gets/sets whether or not the camera is using a perspective or an orthographic view

Type:
  • Boolean
     
  • 1 = True = camera using perspective view
      
  • 0 = False = camara using orthographic view
Note:
  • Perspective View: The size of the game object on the screen depends on it's distance from the camera.  It gets smaller as the distance from the camera increases.
     
  • Orthographic View:  The size of the game object on the screen is always the same size.  It doesn't get smaller as it farther away from the camera.
Sample Code

################## get if camera is using a perspective view
  
# 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 if camera is using a perspective view
type = cam.perspective

Sample Code

################## set the camera's view type
  
# 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"]

# set camera to orthographic view
cam.perspective = False