c3d.camera

The camera module is used for working around with camera objects and the scenes camera

set_position(x, y, z)Changes the position of the current camera
set_rotation(...)Changes the rotation of the current camera
make(x, y, y, dx, dy, dz)Makes a new Camera object with the given parameters
set(camera)Sets the current camera to the given camera object
get()Returns the current camera object
set_transform(transform)Allows you to set a custom transform to the camera
lookat(x, y, z, at_x, at_y, at_z [, near_plane_offset])Allows you to set the cameras rotation and position using 2 vectors.
set_position(x, y, z)Source

Changes the position of the current camera

Parameters

  1. x number the x position of the camera
  2. y number the y position of the camera
  3. z number the z position of the camera
set_rotation(...)Source

Changes the rotation of the current camera

Parameters

  1. dx number the x rotation of the camera
  2. dy number the y rotation of the camera
  3. dz number the z rotation of the camera

Or

  1. x number the quaternion vector x position
  2. y number the quaternion vector y position
  3. z number the quaternion vector z position
  4. w number the rotation along the quaternion vector
make(x, y, y, dx, dy, dz)Source

Makes a new Camera object with the given parameters

Parameters

  1. x number the x position of the camera
  2. y number the y position of the camera
  3. y number the z position of the camera
  4. dx number the x rotation of the camera
  5. dy number the y rotation of the camera
  6. dz number the z rotation of the camera

Returns

  1. camera newly created camera_object

See also

set(camera)Source

Sets the current camera to the given camera object

Parameters

  1. camera the camera object

See also

get()Source

Returns the current camera object

Returns

  1. Current camera object

See also

set_transform(transform)Source

Allows you to set a custom transform to the camera

Parameters

  1. transform table the matrix to use as the camera transform
lookat(x, y, z, at_x, at_y, at_z [, near_plane_offset])Source

Allows you to set the cameras rotation and position using 2 vectors. one indicating the position and second one along with the first one indicating rotation.

Parameters

  1. x number the x coordinate of the camera
  2. y number the y coordinate of the camera
  3. z number the z coordinate of the camera
  4. at_x number the x coordinate of the point the camera should look at
  5. at_y number the y coordinate of the point the camera should look at
  6. at_z number the z coordinate of the point the camera should look at
  7. near_plane_offset? number allows you to offset the near plane by shifting the worlds w by modifying the generated lookat matrix