Camera Object

Functions
Camera Object
Evas » Evas 3D Extensions

A camera object is used for taking a picture of a scene graph. More...

## Functions
EOAPI void | evas_canvas3d_camera_projection_matrix_set (const Evas_Real *matrix)
| Set the projection matrix of the given camera. More...
EOAPI void | evas_canvas3d_camera_projection_matrix_get (Evas_Real *matrix)
| Get the projection matrix of the given camera. More...
EOAPI void | evas_canvas3d_camera_projection_perspective_set (Evas_Real fovy, Evas_Real aspect, Evas_Real dnear, Evas_Real dfar)
| Set the projection matrix of the given camera with perspective projection. More...
EOAPI void | evas_canvas3d_camera_projection_frustum_set (Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top, Evas_Real dnear, Evas_Real dfar)
| Set the projection matrix of the given camera with frustum projection. More...
EOAPI void | evas_canvas3d_camera_projection_ortho_set (Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top, Evas_Real dnear, Evas_Real dfar)
| Set the projection matrix of the given camera with orthogonal projection. More...
EOAPI Eina_Bool | evas_canvas3d_camera_node_visible_get (Evas_Canvas3D_Node *camera_node, Evas_Canvas3D_Node *node, Evas_Canvas3D_Frustum_Mode key)
| Check is bounding sphere of given node inside frustum of camera node. More...

## Detailed Description

A camera object is used for taking a picture of a scene graph.

A camera object itself is just a set of properties on how the camera should take the picture (like focus length and film size of the real world cameras). To be able to take a shot of the scene, a camera should be located in the scene, so that it has its viewing position and direction. It is done by containing the camera on a node. If one wants to locate several cameras having same properties, instead of creating multiple cameras, just create one camera and multiple nodes containing the camera and locate them at each desired position and direction. Just for convenience, use evas_canvas3d_node_position_set() to move the camera to desired position and use evas_canvas3d_node_look_at_set() to adjust the viewing direction of the camera.

## Function Documentation

## ◆ evas_canvas3d_camera_projection_matrix_set()

EOAPI void evas_canvas3d_camera_projection_matrix_set | ( | const Evas_Real * | matrix | ) |

Set the projection matrix of the given camera.

Default projection matrix is identity matrix.

See also evas_canvas3d_camera_projection_perspective_set, evas_canvas3d_camera_projection_ortho_set and evas_canvas3d_camera_projection_frustum_set.

Parameters

  [in] | matrix | Projection Matrix

## ◆ evas_canvas3d_camera_projection_matrix_get()

EOAPI void evas_canvas3d_camera_projection_matrix_get | ( | Evas_Real * | matrix | ) |

Get the projection matrix of the given camera.

See also evas_canvas3d_camera_projection_matrix_set.

Parameters

  [out] | matrix | Projection Matrix

## ◆ evas_canvas3d_camera_projection_perspective_set()

EOAPI void evas_canvas3d_camera_projection_perspective_set | ( | Evas_Real | fovy,
|  | Evas_Real | aspect,
|  | Evas_Real | dnear,
|  | Evas_Real | dfar
| ) |  |

Set the projection matrix of the given camera with perspective projection.

See also evas_canvas3d_camera_projection_matrix_set.

Parameters

  [in] | aspect | Aspect ratio.
  [in] | dnear | Distance to near clipping plane.
  [in] | dfar | Distance to far clipping plane.

## ◆ evas_canvas3d_camera_projection_frustum_set()

EOAPI void evas_canvas3d_camera_projection_frustum_set | ( | Evas_Real | left,
|  | Evas_Real | right,
|  | Evas_Real | bottom,
|  | Evas_Real | top,
|  | Evas_Real | dnear,
|  | Evas_Real | dfar
| ) |  |

Set the projection matrix of the given camera with frustum projection.

See also evas_canvas3d_camera_projection_matrix_set.

Parameters

  [in] | right | Right X coordinate of the near clipping plane..
  [in] | bottom | Bottom Y coordinate of the near clipping plane.
  [in] | top | Top Y coordinate of the near clipping plane
  [in] | dnear | Distance to near clipping plane.
  [in] | dfar | Distance to far clipping plane.

## ◆ evas_canvas3d_camera_projection_ortho_set()

EOAPI void evas_canvas3d_camera_projection_ortho_set | ( | Evas_Real | left,
|  | Evas_Real | right,
|  | Evas_Real | bottom,
|  | Evas_Real | top,
|  | Evas_Real | dnear,
|  | Evas_Real | dfar
| ) |  |

Set the projection matrix of the given camera with orthogonal projection.

See also evas_canvas3d_camera_projection_matrix_set.

Parameters

  [in] | right | Right X coordinate of the near clipping plane..
  [in] | bottom | Bottom Y coordinate of the near clipping plane.
  [in] | top | Top Y coordinate of the near clipping plane
  [in] | dnear | Distance to near clipping plane.
  [in] | dfar | Distance to far clipping plane.

## ◆ evas_canvas3d_camera_node_visible_get()

EOAPI Eina_Bool evas_canvas3d_camera_node_visible_get | ( | Evas_Canvas3D_Node * | camera_node,
|  | Evas_Canvas3D_Node * | node,
|  | Evas_Canvas3D_Frustum_Mode | key
| ) |  |

Check is bounding sphere of given node inside frustum of camera node.

If the nodes are `null` or nodes type mismatch error wrong type of nodes will be generated and returned `false`.

Parameters

  [in] | node | The given node.
  [in] | key |

Returns
  `true` in frustum, `false` otherwise