switching between quaternion and rotation matrix - 3D rotation Matric Problem

조회 수: 5 (최근 30일)
F?rat
F?rat 2013년 11월 1일
답변: F?rat 2013년 12월 9일
Hi, I have been working on transforming my previous code for reflecting points from an arbitrary plane by calculating via analytic solutions to matrix transformations. So basically, I am trying to get a matrix as such : TranslateBack*RotateBack*Reflect*Rotate*Translate (Each are separate 4x4 matrices multiplied with a set of points). Translation and reflection are pretty easy and can be obtained even from Wikipedia. But when I try to rotate my system (including plane and point) in 3 different axes I stuck with gimbal lock. So I made a quick research and quaternions seem like the answer. Yet I have confusion switching between angles (alpha, beta, gamma lets say) to quaternion and integrating to matrix multiplication. Does anyone have an idea of using quaternions in such transformation matrices? Thanks in advance.
Note: I have aerospace toolbox which enables conversion from rotation angles to quaternions easily. Bu I am also quite confused about how to employ these tools.

답변 (3개)

F?rat
F?rat 2013년 11월 1일
Other suggestions for combining 3 rotational matrices of different axis (like Rx*Ry*Rx) other than quaternions are also welcome. =)

Mischa Kim
Mischa Kim 2013년 12월 9일
Based on your information it is not quite clear what exactly you are trying to accomplish. Could you give more detail?

F?rat
F?rat 2013년 12월 9일
Hi Mischa, I was trying to take reflection of any point from any surface. As there is no constraint on the surfaces, in some situations I had to rotate the surface in 3 axis (with respect to x,y,z). However, I noticed that I do not need to rotate one by one. Instead, I could define an arbitrary axis of rotation and handle the rotation operation by one rotation matrix. So, I solved my problem. Thanks for your reply by the way. Also, I am posting useful links discussing rotationa round arbitrary axis for people who may come across the same situation. http://inside.mines.edu/fs_home/gmurray/ArbitraryAxisRotation/ http://www.fastgraph.com/makegames/3drotation/

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by