nodesnim/nodes3d/camera3d

Types

Camera3DObj = object of Node3DObj
  pitch*, yaw*: float
  target*: Node3DRef
  front*: Vector3Obj
  up*: Vector3Obj
  right*: Vector3Obj
Camera3DRef = ref Camera3DObj

Procs

proc Camera3D(name: string = "Camera3D"): Camera3DRef {...}{.raises: [], tags: [].}

Creates a new Camera3D.

Arguments:

  • name is a node name.

Example:

var node = Camera3D("Camera3D")

Methods

method changeTarget(self: Camera3DRef; target: Node3DRef) {...}{.base, raises: [],
    tags: [].}
Changes camera target (without camera position.)
method draw(self: Camera3DRef; w, h: GLfloat) {...}{.raises: [], tags: [].}
this method uses in the window.nim.
method isCurrent(self: Camera3DRef): bool {...}{.base, raises: [], tags: [].}
method setCurrent(self: Camera3DRef) {...}{.base, raises: [], tags: [].}
Changes the current camera. It also automatically disable other cameras.
method rotateX(self: Camera3DRef; val: float) {...}{.raises: [], tags: [].}
method rotateY(self: Camera3DRef; val: float) {...}{.raises: [], tags: [].}
method rotate(self: Camera3DRef; x, y: float) {...}{.base, raises: [], tags: [].}
Rotates camera by x and y values.