scenepic 1.1.0
3D Visualization Made Easy
transforms.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#ifndef _SCENEPIC_TRANSFORMS_H_
5#define _SCENEPIC_TRANSFORMS_H_
6
7#include "matrix.h"
8
9#include <utility>
10
11namespace scenepic
12{
13 namespace Transforms
14 {
19 Transform scale(float scale);
20
25 Transform scale(const Vector& scale);
26
31 Transform translate(const Vector& vec);
32
38 Transform rotation_matrix_from_axis_angle(const Vector& axis, float angle);
39
45 Quaternion quaternion_from_axis_angle(const Vector& axis, float angle);
46
53 std::pair<Vector, float> axis_angle_to_align_x_to_axis(const Vector& axis);
54
60 Quaternion quaternion_to_align_x_to_axis(const Vector& axis);
61
67 Quaternion quaternion_multiply(const Quaternion& a, const Quaternion& b);
68
74 Transform rotation_to_align_x_to_axis(const Vector& axis);
75
80 Transform rotation_about_x(float angle);
81
86 Transform rotation_about_y(float angle);
87
92 Transform rotation_about_z(float angle);
93
103 const Vector& center, const Vector& look_at, const Vector& up_dir);
104
116 const Vector& euler_angles, const std::string& convention = "XYZ");
117
123 Transform quaternion_to_matrix(const Quaternion& quaternion);
124
132 Transform gl_projection(
133 double fov_y_degrees, double aspect_ratio, double znear, double zfar);
134
143 Transform gl_projection(
144 const Intrinsic& camera_matrix,
145 int width,
146 int height,
147 double znear,
148 double zfar);
149
155 Transform gl_world_to_camera(const Extrinsic& extrinsic);
156
157 } // namespace Transforms
158} // namespace scenepic
159
160#endif
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.
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.
Transform quaternion_to_matrix(const Quaternion &quaternion)
Creates a 3D homogeneous rotation matrix from a quaternion.
Transform rotation_about_y(float angle)
Creates a 3D homogeneous rotation matrix about the x-axis.
Transform translate(const Vector &vec)
Creates a 3D homogeneous scale matrix.
Transform gl_world_to_camera(const Extrinsic &extrinsic)
Creates a WebGL view transform (i.e.
Transform scale(float scale)
Creates a 3D homogeneous scale matrix.
Transform rotation_matrix_from_axis_angle(const Vector &axis, float angle)
Creates a 3D homogeneous scale matrix from axis and angle.
Quaternion quaternion_multiply(const Quaternion &a, const Quaternion &b)
Multiply two quaternions.
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.
Transform gl_projection(double fov_y_degrees, double aspect_ratio, double znear, double zfar)
Creates a WebGL projection transform (i.e.
Transform 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 ...
Transform rotation_about_z(float angle)
Creates a 3D homogeneous rotation matrix about the x-axis.
Quaternion quaternion_from_axis_angle(const Vector &axis, float angle)
Convert rotation axis and angle to a quaternion.
Transform rotation_about_x(float angle)
Creates a 3D homogeneous rotation matrix about the x-axis.
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.
Definition: audio_track.h:14