rtgs.camera

Module Contents

Classes

API

class rtgs.camera.Camera(position: taichi.math.vec3, rotation: taichi.math.vec4, buf_size: rtgs.utils.types.vec2i, focal_length: taichi.math.vec2)

Initialization

position: taichi.math.vec3 = None
rotation: taichi.math.vec4 = None
buf_size: rtgs.utils.types.vec2i = None
censor_size: taichi.math.vec2 = None
focal_length: taichi.math.vec2 = None
cam_ray_field: taichi.StructField = None
generate_ray(position, rotation, uv)

Generate ray based on screen space coordinate. (u, v) is from (0, 0) to (1, 1), with (0, 0) being the bottom left of the screen and (1, 1) being the top right of the screen.

Parameters:
  • position (ti.math.vec3) – camera position vec3.

  • rotation (ti.math.vec4) – camera rotation quaternion.

  • uv (ti.math.vec2) – screen space coordinate from (0, 0) to (1, 1).

Returns:

camera ray.

Return type:

Ray

generate_ray_field(position: taichi.math.vec3, rotation: taichi.math.vec4)

Taichi kernel to generate camera ray field.

Parameters:
  • position – camera position vec3.

  • rotation – camera rotation quaternion.