Skip to content

Vector Quantities

Visualize vector-valued data at the points of a point cloud.

PointCloud::addVectorQuantity(std::string name, const T& vectors, VectorType vectorType = VectorType::STANDARD)

Add a vector quantity to the point cloud.

  • vectors is the array of vectors at points. The type should be adaptable to a 3-vector array of floats. The length should be the number of points in the point cloud.
  • vectorType indicates how to interpret vector data. The default setting is as a freely-scaled value, which will be automatically scaled to be visible. Passing VectorType::AMBIENT ensures vectors have the proper world-space length.

Note: the inner vector type of the input must be 3D dimensional, or you risk compiler errors, segfaults, or worse. If you want to add 2D vectors (usually to a 2D point cloud), addVectorQuantity2D exists with the same signature. See 2D data.

Vector Quantity Options

These options and behaviors are available for all types of vector quantities on any structure.

Parameter Meaning Getter Setter Persistent?
enabled is the quantity enabled? bool isEnabled() setEnabled(bool newVal) yes
vector radius the radius vectors are drawn with double getVectorRadius() setVectorRadius(double val, bool isRelative=true) yes
vector length vectors will be scaled so the longest is this long. ignored if VectorType::Ambient double getVectorLengthScale() setVectorLengthScale(double val, bool isRelative=true) yes
vector color the color to draw the vectors with glm::vec3 getVectorColor() setVectorColor(glm::vec3 val) yes
material what material to use std::string getMaterial() setMaterial(std::string name) yes

(all setters return this to support chaining. setEnabled() returns generic quantity, so chain it last)