I have a problem and looking for help, see attached image. I have a number of points (x,y,z) which are treated as connected vectors (first point as first vector base, second point as first vector end AND second vector base, etc) and I need to know the minimal and maximal coordinate points of the whole connected structure. I only know that rotation matrix using quaternion should be applied in the process, but have no such experience. Any insights or links to similar example would be appreciated.
auto rx = _coord_x.data(); auto ry = _coord_y.data(); auto rz = _coord_z.data();
// set up dimensions of coordinates
auto ncoords = number_of_vectors();
for (int32_t i = 0; i < ncoords; i++)
{
//normalization
float fact = 1.0f / std::sqrt(rx[i] * rx[i] + ry[i] * ry[i] + rz[i] * rz[i]);
rx[i] *= fact; ry[i] *= fact; rz[i] = fact;
// rotation matrix ??
}
}
min_x
, then updatemin_x
with this value. Do the same formax_x
and for y and z with all other points. At the end yourmin_x
,min_y
,min_z
andmax_x
,max_y
,max_z
will compose your min and max positions. It'll work, whatever the rotation involved. \$\endgroup\$ – lvictorino Oct 7 '19 at 11:18