Cameras

class yt_idv.cameras.base_camera.BaseCamera(**kwargs)[source]

Bases: traitlets.traitlets.HasTraits

Camera object used in the Interactive Data Visualization

Parameters
  • position (iterable, or 3 element array in code_length) – The initial position of the camera.

  • focus (iterable, or 3 element array in code_length) – A point in space that the camera is looking at.

  • up (iterable, or 3 element array in code_length) – The ‘up’ direction for the camera.

  • fov (float, optional) – An angle defining field of view in degrees.

  • near_plane (float, optional) – The distance to the near plane of the perspective camera.

  • far_plane (float, optional) – The distance to the far plane of the perspective camera.

  • aspect_ratio (float, optional) – The ratio between the height and the width of the camera’s fov.

aspect_ratio

A float trait.

compute_matrices
far_plane

A float trait.

focus
fov

A float trait.

held

A boolean (True, False) trait.

hold_traits(func)[source]
near_plane

A float trait.

orientation

A numpy array trait type.

position
projection_matrix

A numpy array trait type.

up

A numpy array trait type.

update_orientation(start_x, start_y, end_x, end_y)[source]

Change camera orientation matrix using delta of mouse’s cursor position

Parameters
  • start_x (float) – initial cursor position in x direction

  • start_y (float) – initial cursor position in y direction

  • end_x (float) – final cursor position in x direction

  • end_y (float) – final cursor position in y direction

view_matrix

A numpy array trait type.