1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
// .... the previous solution for generating the required random Matrix
Mat A = { { edge.x, third.x, axis.x },
{ edge.y, third.y, axis.y },
{ edge.z, third.z, axis.z }};
//taking and converting the rotation of the first cuboid of the second chain
float ax, ay, az, athet
align_to.get_rotation(ax, ay, az, atheta);
Mat B = rotationMatrix({ax,ay,az}, atheta);
Mat Binv = transpose(B);
Mat ABinv = A * Binv;
Pt monomer_axis;
float new_theta;
axisAngle(ABinv, monomer_axis, new_theta);
|