scenepic 1.1.0
3D Visualization Made Easy
|
Functions | |
Transform | scale (float scale) |
Creates a 3D homogeneous scale matrix. More... | |
Transform | scale (const Vector &scale) |
Creates a 3D homogeneous scale matrix. More... | |
Transform | translate (const Vector &vec) |
Creates a 3D homogeneous scale matrix. More... | |
Transform | rotation_matrix_from_axis_angle (const Vector &axis, float angle) |
Creates a 3D homogeneous scale matrix from axis and angle. More... | |
Quaternion | quaternion_from_axis_angle (const Vector &axis, float angle) |
Convert rotation axis and angle to a quaternion. More... | |
std::pair< Vector, float > | axis_angle_to_align_x_to_axis (const Vector &axis) |
Find the axis and angle of rotation that will ensure the x-axis aligns with the provided axis. More... | |
Quaternion | quaternion_to_align_x_to_axis (const Vector &axis) |
Creates a quaternion rotation vector that will ensure the x-axis aligns with the provided axis. More... | |
Quaternion | quaternion_multiply (const Quaternion &a, const Quaternion &b) |
Multiply two quaternions. More... | |
Transform | rotation_to_align_x_to_axis (const Vector &axis) |
Creates a 3D homogeneous rotation matrix that will ensure the x-axis aligns with the provided axis. More... | |
Transform | rotation_about_x (float angle) |
Creates a 3D homogeneous rotation matrix about the x-axis. More... | |
Transform | rotation_about_y (float angle) |
Creates a 3D homogeneous rotation matrix about the x-axis. More... | |
Transform | rotation_about_z (float angle) |
Creates a 3D homogeneous rotation matrix about the x-axis. More... | |
Transform | look_at_rotation (const Vector ¢er, const Vector &look_at, const Vector &up_dir) |
Creates a 3D homogeneous rotation matrix that will cause an object with the specified center to look at the specified location, with the up direction as given. More... | |
Transform | euler_angles_to_matrix (const Vector &euler_angles, const std::string &convention="XYZ") |
Creates a 3D homogeneous rotation matrix from three euler angles using the specified convention. More... | |
Transform | quaternion_to_matrix (const Quaternion &quaternion) |
Creates a 3D homogeneous rotation matrix from a quaternion. More... | |
Transform | gl_projection (double fov_y_degrees, double aspect_ratio, double znear, double zfar) |
Creates a WebGL projection transform (i.e. More... | |
Transform | gl_projection (const Intrinsic &camera_matrix, int width, int height, double znear, double zfar) |
Creates a WebGL projection transform (i.e. More... | |
Transform | gl_world_to_camera (const Extrinsic &extrinsic) |
Creates a WebGL view transform (i.e. More... | |
std::pair< Vector, float > scenepic::Transforms::axis_angle_to_align_x_to_axis | ( | const Vector & | axis | ) |
Find the axis and angle of rotation that will ensure the x-axis aligns with the provided axis.
NB one degree of freedom is underconstrained.
axis | the axis to which to align the x-axis |
Transform scenepic::Transforms::euler_angles_to_matrix | ( | const Vector & | euler_angles, |
const std::string & | convention = "XYZ" |
||
) |
Creates a 3D homogeneous rotation matrix from three euler angles using the specified convention.
See https://en.wikipedia.org/wiki/Euler_angles for more information on valid conventions. Conventions are specified as a three character string indicating the convention order, with values taken from [X, Y, Z].
euler_angles | the Euler angles to use in constructing the matrix |
convention | the convention to use in interpreting the angles |
Transform scenepic::Transforms::gl_projection | ( | const Intrinsic & | camera_matrix, |
int | width, | ||
int | height, | ||
double | znear, | ||
double | zfar | ||
) |
Creates a WebGL projection transform (i.e.
that goes from view coordinates to NDC) from an OpenCV-style camera matrix.
camera_matrix | the OpenCV-style camera matrix |
width | the width of the calibration image in pixels |
height | the height of the calibration image in pixels |
znear | the z value of the near clipping plane of the frustum |
zfar | the z value of the far clipping plane of the frustum |
Transform scenepic::Transforms::gl_projection | ( | double | fov_y_degrees, |
double | aspect_ratio, | ||
double | znear, | ||
double | zfar | ||
) |
Creates a WebGL projection transform (i.e.
that goes from view coordinates to NDC).
fov_y_degrees | the field of view of the camera in degrees |
aspect_ratio | the aspect ratio of the camera |
znear | the z value of the near clipping plane of the frustum |
zfar | the z value of the far clipping plane of the frustum |
Transform scenepic::Transforms::gl_world_to_camera | ( | const Extrinsic & | extrinsic | ) |
Creates a WebGL view transform (i.e.
that goes from world coordinates to camera view coordinates) from an OpenCV-style extrinsic matrix
extrinsic | the camera-to-world matrix, which places the camera in the scene |
Transform scenepic::Transforms::look_at_rotation | ( | const Vector & | center, |
const Vector & | look_at, | ||
const Vector & | up_dir | ||
) |
Creates a 3D homogeneous rotation matrix that will cause an object with the specified center to look at the specified location, with the up direction as given.
center | the center of the object |
look_at | the position to look at |
up_dir | the direction that is "up" |
Quaternion scenepic::Transforms::quaternion_from_axis_angle | ( | const Vector & | axis, |
float | angle | ||
) |
Convert rotation axis and angle to a quaternion.
axis | the axis of rotation |
angle | the angle to rotate in radians |
Quaternion scenepic::Transforms::quaternion_multiply | ( | const Quaternion & | a, |
const Quaternion & | b | ||
) |
Multiply two quaternions.
a | the first quaternion |
b | the second quaternion |
Quaternion scenepic::Transforms::quaternion_to_align_x_to_axis | ( | const Vector & | axis | ) |
Creates a quaternion rotation vector that will ensure the x-axis aligns with the provided axis.
NB one degree of freedom is underconstrained.
axis | the axis to which to align the x-axis |
Transform scenepic::Transforms::quaternion_to_matrix | ( | const Quaternion & | quaternion | ) |
Creates a 3D homogeneous rotation matrix from a quaternion.
quaternion | the quaternion to convert |
Transform scenepic::Transforms::rotation_about_x | ( | float | angle | ) |
Creates a 3D homogeneous rotation matrix about the x-axis.
angle | the angle to rotate in radians |
Transform scenepic::Transforms::rotation_about_y | ( | float | angle | ) |
Creates a 3D homogeneous rotation matrix about the x-axis.
angle | the angle to rotate in radians |
Transform scenepic::Transforms::rotation_about_z | ( | float | angle | ) |
Creates a 3D homogeneous rotation matrix about the x-axis.
angle | the angle to rotate in radians |
Transform scenepic::Transforms::rotation_matrix_from_axis_angle | ( | const Vector & | axis, |
float | angle | ||
) |
Creates a 3D homogeneous scale matrix from axis and angle.
axis | the axis of rotation |
angle | the angle to rotate in radians |
Transform scenepic::Transforms::rotation_to_align_x_to_axis | ( | const Vector & | axis | ) |
Creates a 3D homogeneous rotation matrix that will ensure the x-axis aligns with the provided axis.
NB one degree of freedom is underconstrained.
axis | the axis to which to align the x-axis |
Transform scenepic::Transforms::scale | ( | const Vector & | scale | ) |
Creates a 3D homogeneous scale matrix.
scale | the axis-specific scale values |
Transform scenepic::Transforms::scale | ( | float | scale | ) |
Creates a 3D homogeneous scale matrix.
scale | the scale to use across all axes |
Transform scenepic::Transforms::translate | ( | const Vector & | vec | ) |
Creates a 3D homogeneous scale matrix.
vec | the movement vector |