MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ apply_rotation()

void MayaFlux::Kinesis::apply_rotation ( std::vector< glm::vec3 > &  vertices,
const glm::vec3 &  axis,
float  angle,
const glm::vec3 &  origin = glm::vec3(0) 
)

Apply rotation to vertex set around arbitrary axis.

Parameters
verticesVertices to transform (modified in-place)
axisRotation axis (will be normalized)
angleRotation angle in radians (right-hand rule)
originRotation center (default: world origin)

Definition at line 181 of file GeometryPrimitives.cpp.

186{
187 glm::vec3 normalized_axis = glm::normalize(axis);
188
189 glm::mat4 transform = glm::translate(glm::mat4(1.0F), origin);
190 transform = glm::rotate(transform, angle, normalized_axis);
191 transform = glm::translate(transform, -origin);
192
193 apply_transform(vertices, transform);
194}
void apply_transform(std::vector< glm::vec3 > &vertices, const glm::mat4 &transform)
Apply rigid transformation to vertex set.

References apply_transform().

+ Here is the call graph for this function: