Sign in to follow this  
Supernat02

LOS Vector Problem

Recommended Posts

Hi, I have the following problem and would appreciate any help. Thanks. I have a spaceship with 6 degrees of freedom, indicated at any given time by yaw, pitch, and roll angles. I have a camera attached to the spaceship with the ability to move in a limited FOR. For simplicity, the camera is at the center of the spaceship and doesn't have the spaceship model in its view. I don't keep track of the camera's yaw, pitch, roll angles with respect to the spaceship, but I do calculate them with respect to the global coordinate system (XYZ axes). I also know the global az/el values. What I want to know is the az/el values with respect to the spaceship. For instance, no matter which way the spaceship is facing or rotated toward, the camera is still 10 degrees down and 10 degrees right because it is attached to the spaceship. I know it has something to do with a transformation. Please tell me if my idea is right or wrong if you can. I take the global az/el values, create a vector from them, transform that vector by the inverse of the spaceship's roll/pitch/yaw matrix, then convert the new vector back to az/el. Is it that simple? Do I have the order of rotations right? Thanks!

Share this post


Link to post
Share on other sites
You have the "global" orientations of the spaceship, S, and the camera, C, and you are looking for the orientation of the camera relative to the spaceship -- a value of M that satisfies this equation: S = CM (assuming column vectors). Solve for M:
    S = CM
C-1S = C-1CM
C-1S = M
BTW, with 6 DOF, you are going to run into problems (specifically "gimbal lock") if you keep track of your spaceship's and camera's orientations using yaw, pitch, and roll.

Share this post


Link to post
Share on other sites
I don't use yaw, pitch, and roll to keep track of it. They are calculated from direction cosines. The approach I wrote (pretty sure it's the same equation you suggested) worked.

Thanks!

Share this post


Link to post
Share on other sites

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