简体   繁体   中英

Deducing a 3D rotation matrix from two transformed 3D vectors

I am currently trying to deduce a full rotation matrix R based on two couples of 3D vectors (V1, V1 t ) and (V2, V2 t ) such that

  • V1 t =R*V1
  • V2 t =R*V2
  • V1 and V2 are picked orthogonal to each other.

Two couples of vectors are used since a single couple of vectors (V1 and its transformed vector, V1 t ) does not bring enough information to construct the rotation matrix R. A good example to illustrate that is for instance V1 lying on the rotation axis of R.

The idea is to build two partial rotation matrices R1 and R2 in order to obtain the final matrix R.

The implementation is using GLM and R1 and R2 are computed as following

R1 = math::mat3_cast(math::rotation(V1, V1t));
R2 = math::mat3_cast(math::rotation(V2, V2t));

My guessing is that, before computing R , the rotation along axis V1 should be isolated from R2 giving R2'.

R would then be R1 * R2'.

My questions are

  • At first, is this viable to deduce a rotation matrix from two couples of transformed 3D vectors ? (The two original vectors V1 and V2 being taken as orthogonal to each other)
  • How to extract the rotation along an arbitrary axis from a rotation matrix ?

You're on the right track but I'd change it a bit.

Maybe try this way:

  • Compute R1 from (V1, V1t)
  • Rotate V2 with R1, result is V2R
  • Compute R2 from (V2R, V2t)
  • Concatenate R1 and R2 to get the final rotation

It should be easier than trying to isolate rotation along some axis.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM