OpenMesh has its VectorT class which I believe is used to carry out all sorts of position vector operations (additions/subtractions, inner and outer products, etc.). Are there any examples available on how to actually use it? I would be in particular interested in
- How to define and initialize a 3D vector of coordinates
- How to properly convert a vertex position (of Point type) to a VectorT type, or, alternatively, how to get a vertex position as a VectorT type right away. So far I'm using
mesh.point(vhandle)which, however, returns aPoint()type.
Edit: Apparently Point is some kind of VectorT itself because the VectorT member functions work on Point objects as well.
Examples for math operation using OpenMesh native point type:
OpenMesh::Vec3f myVec = OpenMesh::Vec3f(0, 0, 0);float distance = (point1 - point2).norm();also available:l1_norm(),l8_norm(),sqrnorm()Point interpolated_point = (1 - a) * point1 + a * point2;Vec3f crossProduct = vec1 % vec2;only defined forVec3(and as you mentionedPoint)Vec3f dotProduct = vec1 | vec2;