139 SC_CAMERA_PLANE_NEAR,
141 SC_CAMERA_PLANE_LEFT,
142 SC_CAMERA_PLANE_RIGHT,
144 SC_CAMERA_PLANE_BOTTOM
void sc_camera_position(sc_camera_t *camera, const sc_camera_vec3_t position)
Sets the position.
void sc_camera_aspect_ratio(sc_camera_t *camera, int width, int height)
Sets the aspect ratio.
void sc_camera_init(sc_camera_t *camera)
Initializes a camera with the default parameters.
void sc_camera_clipping_pre(const sc_camera_t *camera, sc_array_t *points, sc_array_t *indices)
Determines the indices of points that are visible within the camera's view frustum.
double sc_camera_coords_t
The data type of the coordinates for sc_camera.
Definition sc_camera.h:113
sc_camera_coords_t sc_camera_vec4_t[4]
Points in R^4 for sc_camera.
Definition sc_camera.h:121
sc_camera_coords_t sc_camera_vec3_t[3]
Points in R^3 for sc_camera.
Definition sc_camera.h:117
sc_camera_plane
Defines the order of the 6 planes of the camera's view frustum.
Definition sc_camera.h:138
void sc_camera_clipping_post(sc_array_t *points, sc_array_t *indices)
Performs clipping in normalized device coordinates (NDC) space.
void sc_camera_frustum_dist(const sc_camera_t *camera, const sc_camera_vec3_t point, sc_camera_coords_t distances[6])
Computes the signed distances of a point to the 6 planes of the camera's view frustum.
void sc_camera_get_frustum(const sc_camera_t *camera, sc_array_t *planes)
Returns the 6 planes of the view frustum.
void sc_camera_destroy(sc_camera_t *camera)
Destroys a camera structure.
sc_camera_coords_t sc_camera_mat3x3_t[9]
3 times 3 matrix for sc_camera.
Definition sc_camera.h:131
void sc_camera_get_projection_mat(const sc_camera_t *camera, sc_camera_mat4x4_t proj_matrix)
Returns the projection transformation matrix.
void sc_camera_roll(sc_camera_t *camera, double angle)
Rotating the camera around the backward axis.
struct sc_camera sc_camera_t
Represents a camera with parameters for rendering a 3D scene.
void sc_camera_yaw(sc_camera_t *camera, double angle)
Rotating the camera around the up axis.
sc_camera_t * sc_camera_new(void)
Creates a new camera structure with the default values (see sc_camera_init).
void sc_camera_view_transform(const sc_camera_t *camera, sc_array_t *points_in, sc_array_t *points_out)
Performs the view transformation from world space to view space.
void sc_camera_fov(sc_camera_t *camera, double angle)
Sets the horizontal field of view.
void sc_camera_perspective_division(sc_array_t *points_in, sc_array_t *points_out)
Performs perspective division.
void sc_camera_look_at(sc_camera_t *camera, const sc_camera_vec3_t eye, const sc_camera_vec3_t center, const sc_camera_vec3_t up)
Sets the position and rotation of the camera object.
void sc_camera_projection_transform(const sc_camera_t *camera, sc_array_t *points_in, sc_array_t *points_out)
Performs the projection transformation from view space to normalized device coordinates.
void sc_camera_pitch(sc_camera_t *camera, double angle)
Rotating the camera around the axis to the right.
void sc_camera_walk(sc_camera_t *camera, double distance)
Move the camera backward/forward along the view direction.
enum sc_camera_plane sc_camera_plane_t
Defines the order of the 6 planes of the camera's view frustum.
void sc_camera_get_view_mat(const sc_camera_t *camera, sc_camera_mat4x4_t view_matrix)
Returns the view transformation matrix.
sc_camera_coords_t sc_camera_mat4x4_t[16]
4 times 4 matrix for sc_camera.
Definition sc_camera.h:126
void sc_camera_clipping_dist(sc_camera_t *camera, sc_camera_coords_t near_plane, sc_camera_coords_t far_plane)
Sets the clipping distances.
Dynamic containers such as lists, arrays, and hash tables.
The sc_array object provides a dynamic array of equal-size elements.
Definition sc_containers.h:118
Represents a camera with parameters for rendering a 3D scene.
Definition sc_camera.h:156
sc_camera_coords_t far_plane
Distance to the far clipping plane.
Definition sc_camera.h:174
int width
Image width in pixels, used to determine the aspect ratio.
Definition sc_camera.h:168
double FOV
Horizontal field of view (in radians), defining the frustum's opening angle horizontally.
Definition sc_camera.h:164
int height
Image height in pixels, used to determine the aspect ratio.
Definition sc_camera.h:170
sc_camera_coords_t near_plane
Distance to the near clipping plane.
Definition sc_camera.h:173
sc_camera_vec4_t frustum_planes[6]
The bounding planes of the view frustum (see sc_camera_get_frustum).
Definition sc_camera.h:176
sc_camera_vec4_t rotation
Rotation from world space to view space, represented as a unit quaternion.
Definition sc_camera.h:160
sc_camera_vec3_t position
The position of the camera in world coordinates.
Definition sc_camera.h:157