• Create Account

# need to find corner points of view area

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1Suspense  Members   -  Reputation: 449

Like
0Likes
Like

Posted 23 May 2012 - 04:47 PM

I'm interfacing with a video camera mounted on a plane. The camera can tell me its GPS position (latitude, longitude, altitude) and the GPS position of its view area's center point (called Line of Sight). I also know the camera's horizontal field of view and aspect ratio. I can also acquire the plane's heading, pitch and roll, and the heading and pitch angles of the camera. The library I'm using (like Google Earth in Java) can convert between GPS positions and Cartesian coordinates used by OpenGL and can also do a ray cast against Earth geometry and return the point of collision.

I want to find the four corners of the camera's viewing area as GPS positions so I can draw the camera's view on the globe. As I said, if I can get the Cartesian coords then I can do the conversion to GPS. Here's what I have so far.
• Convert camera position and line of sight to Cartesian coords.
• Calculate the camera's direction vector: losPosition - cameraPosition
• For each corner, rotate the direction vector by half the field of view in each direction
• Use the camera point and rotated direction vector as a ray; do a raycast into earth geometry
• Convert collision point back into GPS position
When I draw the resulting bounding box, it's in the right area on the globe, but the shape is totally wrong. My guess is that I need to rotate the rays around the plane's up/forward/right axes instead of the world axes. Am I on the right track? If so, is there an easy way to find those axes? Can you think of an easier, or even just different, approach to this problem?

### #2gram  Members   -  Reputation: 104

Like
0Likes
Like

Posted 24 May 2012 - 06:58 PM

You are indeed on the right track.

What you need to do is use the heading, and roll to determine the plane's axes. I'm confused about the pitch variable, though. If you know your line of sight, only roll (rotation about the line of sight) is needed to determine your orientation. What is pitch for?

### #3Suspense  Members   -  Reputation: 449

Like
0Likes
Like

Posted 25 May 2012 - 06:53 AM

I was just listing the relevant information that I can get from the camera. But wouldn't pitch be necessary to find the right axes? If the plane is pitched up or down that would certainly seem to make a difference on its forward and up vectors.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS