![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Feb 2008
Location: Melbourne, FL, USA
Posts: 678
![]() |
I've implemented a DropTargetListener with the following:
PHP Code:
PHP Code:
So I'm assuming there is an absolute vs relative issue here. Is there a magical way to convert between java.awt.Point and gov.nasa.worldwind.geom.Position? |
|
|
|
|
|
#2 |
|
WWJ Dev. Team
Join Date: May 2007
Posts: 449
![]() |
heidtmare,
This looks like a simple oversight: the method Globe.computePositionFromPoint transforms a model-coordinate Cartesian point to spherical coordinates. Since you are specifying screen-coordinate values which happen to be small relative to model-coordiante values, the code above essentially transforms points near the center of the earth to their corresponding spherical value. Please try replacing usage of Globe.computePointFromPosition with View.computePositionFromScreenPoint, and let us know if that resolves the issue. Note that View.computePositionFromScreenPoint returns null if the point is off the globe. Thanks, Dave |
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2008
Posts: 84
![]() |
I did the same DropTarget thing a while back using this:
Line lineRay = wwm.getWorldWindow().getView().computeRa yFromScreenPoint(p.x, p.y); Position dropPosition = wwm.getWorldWindow().getView().getGlobe( ).getIntersectionPosition(lineRay); |
|
|
|
|
|
#4 |
|
WWJ Dev. Team
Join Date: May 2007
Posts: 449
![]() |
workingDog,
Please note that View.computePositionFromScreenPoint does exactly what you outline in your post. It would be worth using this method instead of your own, unless you have other logic that what you've shown above. Thanks, Dave |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Feb 2008
Location: Melbourne, FL, USA
Posts: 678
![]() |
yep, i knew i was doing something silly... thanks guys.
__________________
Member
Join Date: Mar 2008
Posts: 84
![]() |
yes, much better to use View.computePositionFromScreenPoint
thanks |
|
|
|
![]() |
| Tags |
| resolved |
| 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 |
| Get screen point from position | tmuic | Development Help | 4 | 02-14-2012 05:14 PM |
| View eye position help needed | SpecterTerrasbane | Development Help | 0 | 08-19-2011 05:17 PM |
| Getting globe position on a mouse click in a 3D projection | borsightjohn | Development Help | 12 | 12-15-2009 01:41 AM |
| [Solved] Polyline Position does not match Point Position | Morris | Development Help | 4 | 07-03-2009 01:36 AM |
| Get screen point for click position in select event | naql | Development Help | 3 | 08-04-2008 05:58 PM |