Previous topic

collada.camera.OrthographicCamera

Next topic

collada.common

This Page

collada.camera.PerspectiveCamera

class collada.camera.PerspectiveCamera(id, znear, zfar, xfov=None, yfov=None, aspect_ratio=None, xmlnode=None)

Bases: collada.camera.Camera

Perspective camera as defined in COLLADA tag <perspective>.

digraph inheritance36891bae67 { rankdir=LR; size="8.0, 12.0"; "BoundCamera" [style="setlinewidth(0.5)",URL="collada.camera.BoundCamera.html#collada.camera.BoundCamera",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "OrthographicCamera" [style="setlinewidth(0.5)",URL="collada.camera.OrthographicCamera.html#collada.camera.OrthographicCamera",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "Camera" -> "OrthographicCamera" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Camera" [style="setlinewidth(0.5)",URL="collada.camera.Camera.html#collada.camera.Camera",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "DaeObject" -> "Camera" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PerspectiveCamera" [style="setlinewidth(0.5)",URL="#collada.camera.PerspectiveCamera",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "Camera" -> "PerspectiveCamera" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoundOrthographicCamera" [style="setlinewidth(0.5)",URL="collada.camera.BoundOrthographicCamera.html#collada.camera.BoundOrthographicCamera",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "BoundCamera" -> "BoundOrthographicCamera" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DaeObject" [style="setlinewidth(0.5)",URL="collada.common.DaeObject.html#collada.common.DaeObject",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "BoundPerspectiveCamera" [style="setlinewidth(0.5)",URL="collada.camera.BoundPerspectiveCamera.html#collada.camera.BoundPerspectiveCamera",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "BoundCamera" -> "BoundPerspectiveCamera" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

__init__(id, znear, zfar, xfov=None, yfov=None, aspect_ratio=None, xmlnode=None)

Create a new perspective camera.

Note: aspect_ratio = tan(0.5*xfov) / tan(0.5*yfov)

You can specify one of:

Any other combination will raise collada.common.DaeMalformedError

Parameters:
  • id (str) – Identifier for the camera
  • znear (float) – Distance to the near clipping plane
  • zfar (float) – Distance to the far clipping plane
  • xfov (float) – Horizontal field of view, in degrees
  • yfov (float) – Vertical field of view, in degrees
  • aspect_ratio (float) – Aspect ratio of the field of view
  • xmlnode – If loaded from xml, the xml node

Methods

__init__(id, znear, zfar[, xfov, yfov, ...]) Create a new perspective camera.
bind(matrix) Create a bound camera of itself based on a transform matrix.
load(collada, localscope, node)
save() Saves the perspective camera’s properties back to xmlnode
id = None

Identifier for the camera

xfov = None

Horizontal field of view, in degrees

yfov = None

Vertical field of view, in degrees

aspect_ratio = None

Aspect ratio of the field of view

znear = None

Distance to the near clipping plane

zfar = None

Distance to the far clipping plane

xmlnode = None

ElementTree representation of the data.

save()

Saves the perspective camera’s properties back to xmlnode

bind(matrix)

Create a bound camera of itself based on a transform matrix.

Parameters:matrix (numpy.array) – A numpy transformation matrix of size 4x4
Return type:collada.camera.BoundPerspectiveCamera