![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2009
Posts: 17
![]() |
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. |
|
|
|
|
|
#2 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
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. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2009
Posts: 17
![]() |
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! |
|
|
|
|
|
#4 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
view.getFieldOfView() : Angle
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Oct 2009
Posts: 17
![]() |
Great. Thanks a lot!
|
|
|
|
![]() |
| Tags |
| camera altitude, view field, zoom |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |