?
Solved

Another quaternion question

Posted on 2003-03-24
4
Medium Priority
?
354 Views
Last Modified: 2008-02-01
How do I figure out the 'heading' vector given a certain quaternion representing the object's orientation.

Using directX I can get the rotation matrix. is there a way to do the invesre of the D3DXMatrixLookAt for the 3 vectors (or 1 of them for that matter)?

Cheers,
Krip
0
Comment
Question by:Krip
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:joachimc
ID: 8201284
You can go back to a rotation matrix from a quaternion

D3DXMatrixRotationQuaternion

You can also try this

D3DXQuaternionToAxisAngle

Hope this helps
0
 

Author Comment

by:Krip
ID: 8201482
Maybe I wasn't clear...

I have the rotation matrix, what I'm looking for is the LookAt vector i.e. the vector in the same direction as my object's 'heading'

D3DXLookAtLH takes 3 vectors lookAt, eye and up and builds a rotation matrix from them. Is There a way to do the opposite?

Cheers,
Krip

0
 
LVL 2

Accepted Solution

by:
limestar earned 500 total points
ID: 8202664
If you know the original heading vector, all you need to do is rotate it by the orientation quaternion/matrix. That is, if the original orientation vector (say v) is (0, 0, -1), you just need to use the matrix (let's call it M) to rotate it as M * v. You'll then have a rotated orientation vector, i.e. the "looks at" vector.
0
 

Author Comment

by:Krip
ID: 8203102
Naturally....
Thanks
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question