Sign in to follow this  

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

This topic is 3854 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
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

This topic is 3854 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this