• Create Account

### #Actualgluontronic

Posted 23 June 2012 - 01:44 AM

I have a camera quaternion (a,b,c,d) and a cam position (camX, camY, camZ)
I have an object with 3d coordinates (x,y,z)

I need to calculate azimuth, elevation of objects relatively to the cam view direction & plane.

First question
If I keep the object in center of my view (I mean, if I aim at it with my cam), even If I rotate the cam, translate it keeping the object in the center, I should have the same azimuth value, right ??
I don't have that.

Second question, the calculation.
I'm doing (object coordinates - cam position), in order to translate the object to the cam.
I'm taking the resulting coordinates and make the sandwich product with the quaternion and its conjugate.
(I followed this for the pseudo code :http://fr.wikipedia....ns_l&#39;espace)

Then, I have a vector result and I take X & Z component and calculate the atan2.
Does it seem right ?
any leads or explanation would help me a lot in my struggle

### #1gluontronic

Posted 23 June 2012 - 01:44 AM

I have a camera quaternion (a,b,c,d) and a cam position (camX, camY, camZ)
I have an object with 3d coordinates (x,y,z)

I need to calculate azimuth, elevation of objects relatively to the cam view direction & plane.

First question
If I keep the object in center of my view (I mean, if I aim at it with my cam), even If I rotate the cam, translate it keeping the object in the center, I should have the same azimuth value, right ??
I don't have that.

Second question, the calculation.
I'm doing (object coordinates - cam position), in order to translate the object to the cam.
I'm taking the resulting coordinates and make the sandwich product with the quaternion and its conjugate.
(I followed this for the pseudo code :http://fr.wikipedia.org/wiki/Quaternions_et_rotation_dans_l'espace)

Then, I have a vector result and I take X & Z component and calculate the atan2.

Does it seem right ?

any leads or explanation would help me a lot in my struggle

PARTNERS