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

◆ project_onto_plane()

void MayaFlux::Kinesis::project_onto_plane ( std::vector< glm::vec3 > &  vertices,
const glm::vec3 &  plane_point,
const glm::vec3 &  plane_normal 
)

Project vertices onto plane defined by normal.

Parameters
verticesVertices to project (modified in-place)
plane_pointPoint on projection plane
plane_normalPlane normal vector

Definition at line 455 of file GeometryPrimitives.cpp.

459{
460 glm::vec3 n = glm::normalize(plane_normal);
461
462 for (auto& vertex : vertices) {
463 glm::vec3 offset = vertex - plane_point;
464 float distance = glm::dot(offset, n);
465 vertex = vertex - distance * n;
466 }
467}
SpatialField distance(const glm::vec3 &anchor, float radius, DistanceMetric metric=DistanceMetric::EUCLIDEAN)
Normalized distance from an anchor point using the specified metric.

References distance().

+ Here is the call graph for this function: