World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 10-23-2009, 07:40 PM   #1
QA_2
Junior Member
 
Join Date: Oct 2009
Posts: 17
QA_2 is on a distinguished road
Post Deciding Camera Altitude for view field

Hey, all. I have a pair of lat/long points, and want to zoom in/out to the point where they're in opposite corners of the view field. Does anyone know how to go from that to a camera altitude number I can feed into a FlyToOrbitViewAnimator?


I know enough trigonometry to picture the problem as an isosceles triangle where the bottom side is the line between my two points, and I'm looking to calculate the height, but I'd need to know the top angle (i.e. the angle between edges of the camera's field of view). Besides, I feel like there must be a call for this somewhere.
QA_2 is offline   Reply With Quote
Old 10-25-2009, 04:30 AM   #2
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

The eye field of view is the angle between the eye and both sides (left and right) of the viewport.

From your two locations you can devive an angular distance between the two - see LatLon.greatCircleDistance(), and a center location - see LatLon.greatCircleEndPosition(). You can then think of the circle encompassing the two points and determine the proper eye altitude to fit that circle in the viewport rectangle... There are certainly different ways to do that.

I think i briefly glanced something related in the SDK but can't remember exactly what and where.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 10-25-2009, 10:01 AM   #3
QA_2
Junior Member
 
Join Date: Oct 2009
Posts: 17
QA_2 is on a distinguished road
Default

Don't suppose you know a way to get the eye field angle, do you? Even if not, this should help a lot, since now I know what the number I'm called is looking for! And once I have that number, the math shouldn't be a problem.

Thanks!
QA_2 is offline   Reply With Quote
Old 10-25-2009, 02:41 PM   #4
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

view.getFieldOfView() : Angle
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 10-25-2009, 11:06 PM   #5
QA_2
Junior Member
 
Join Date: Oct 2009
Posts: 17
QA_2 is on a distinguished road
Default

Great. Thanks a lot!
QA_2 is offline   Reply With Quote
Reply

Tags
camera altitude, view field, zoom


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WW1.3.2-Plugin: Layer Edit canosso Add-ons & Scripts 21 02-27-2010 04:37 AM
Fixing the Camera : help w math please patmurris Developers' Corner 8 05-08-2007 02:28 PM
WW 1.4 Altitude is wrong !? patmurris Builds 2 12-14-2006 10:56 AM
How to set camera altitude? jumpjack Developers' Corner 4 07-10-2005 03:59 PM
Altitude problems in plugin Dugrhill Add-on & Script Development 2 06-15-2005 07:05 PM


All times are GMT +1. The time now is 04:31 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.