Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Another quaternion question

Posted on 2003-03-24
4
Medium Priority
?
360 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
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

580 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