Jump to content
  • Advertisement
Sign in to follow this  
cbastien

convert 1 vector and 1 angle to 3 vectors and 3 angles ll quaternion to latitude,long

This topic is 4069 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello, I would like to know how to convert a vector and an angle like (Vector3D(0.8,0.5,-0.9),0.65) 0.65 //is the angle to three vector like that Vector3D(1,0,0),angle_x Vector3D(0,1,0),angle_y Vector3D(0,0,1),angle_z i try to use porportion but that doesn't work, thanks for any help ! [Edited by - cbastien on May 29, 2007 2:08:40 AM]

Share this post


Link to post
Share on other sites
Advertisement
Your question is not very well defined. I assume you want to convert an axis-angle pair into Euler angles. This is complicated by the fact that we do not know what Euler angle convention you are using. See here for guidance.

Share this post


Link to post
Share on other sites
It almost seems like you wish to write an arbitrary 3D vector in terms of some orthogonal basis {v1,v2,v3} of R^3? I am not certain what the angle is for?

Let u = (x_1,x_2,x_3) then (u . v1/(v1.v1))v1 + (u . v2/(v2.v2))v2+ (u . v3/(v3.v3))v3 is the linear combination you seek? It is quite a bit more involved if you do not already have the orthogonal basis.

The angle u makes with each of the axes is acos(x_n/|u|) for n = 1,2,3

[Edited by - Daerax on May 25, 2007 12:16:54 PM]

Share this post


Link to post
Share on other sites
thanks for the reply, i'm sorry i do not have access to internet the weekend !

I'm using quaternion in my opengl program.

the camera is used to turn around a sphere.

I convert a latitude and longitude to a quaternion like this :

q1.AxisToQuat(Vector3D(0,1,0),longi);
q2.AxisToQuat(Vector3D(1,0,0),lati);
camera_quat=q1*q2;


Now i would like to do the opposite computation, i mean find a latitude and longitude from a quaternion.

[Edited by - cbastien on May 28, 2007 5:49:01 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!