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

◆ project_onto_plane()

MAYAFLUX_API 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 516 of file GeometryPrimitives.cpp.

520{
521 glm::vec3 n = glm::normalize(plane_normal);
522
523 for (auto& vertex : vertices) {
524 glm::vec3 offset = vertex - plane_point;
525 float distance = glm::dot(offset, n);
526 vertex = vertex - distance * n;
527 }
528}
uint64_t offset
Definition Composite.cpp:10
SpatialField distance(const glm::vec3 &anchor, float radius, DistanceMetric metric=DistanceMetric::EUCLIDEAN)
Normalized distance from an anchor point using the specified metric.

References distance(), and offset.

+ Here is the call graph for this function: