World Wind Forums

Go Back   World Wind Forums > Support > Bug Reports

Bug Reports If you've found a bug in World Wind, discuss it here.

Reply
 
Thread Tools Display Modes
Old 08-01-2012, 02:43 PM   #1
BuM
Member
 
Join Date: Jan 2012
Posts: 94
BuM is on a distinguished road
Default FireSupportLine labels with height shifted on round globe

Hi there,

haven't seen this anywhere yet, so here I go.

Under some circumstances the labels of the FireSupportLine (and possibly other Symbology lines/graphics) are shifted heavily on a round globe, if they are provided a height. On a flat globe, everything looks as expected (if the total ignorance of the height value is to be expected):
Name:  FireSupportLine_FlatGlobe.jpg
Views: 118
Size:  170.9 KB

However, the exact same line has labels shifted along the line when we switch to a round globe (don't mind the different map zoom):
Name:  FireSupportLine_RoundGlobe.jpg
Views: 70
Size:  311.3 KB

Here is the test code for easy reproducability:
Code:
public class TestFireSupport extends ApplicationTemplate {
	final static int LAT = 45;
	final static int LON = 0;
    public static class MyApp extends ApplicationTemplate.AppFrame {

		public MyApp() {
			
    		this.setExtendedState(MAXIMIZED_BOTH);	// maximize window
			RenderableLayer layer = new RenderableLayer();
			layer.setPickEnabled(false);
			
			// FireSupport
			FireSupportLine fireSupportLine = new FireSupportLine("GFFPLCF--------");
			fireSupportLine.setText("Text");
			fireSupportLine.setAdditionalText("Additional Text");
			
			ArrayList<Position> positions = new ArrayList<Position>();
			positions.add(Position.fromDegrees(LAT-1, LON-1, 100000));
			positions.add(Position.fromDegrees(LAT+1, LON-1, 100000));
			positions.add(Position.fromDegrees(LAT+1, LON+1, 100000));
			positions.add(Position.fromDegrees(LAT-1, LON+1, 100000));
			fireSupportLine.setPositions(positions);
			
			layer.addRenderable(fireSupportLine);

    		getWwd().getModel().getLayers().add(layer);
			getLayerPanel().update(getWwd());
			
			this.getLayerPanel().add(new FlatWorldPanel(this.getWwd()), BorderLayout.SOUTH);
		}
		
    }
    
	public static void main(String[] args) {
    	Configuration.setValue(AVKey.INITIAL_LATITUDE, LAT);
        Configuration.setValue(AVKey.INITIAL_LONGITUDE, LON);
        Configuration.setValue(AVKey.INITIAL_ALTITUDE, 500000);

        ApplicationTemplate.start(MyApp.class.getEnclosingClass().getSimpleName(), MyApp.class);
	}

}
The shifting is influenced by several factors:
- The bigger the height value, the further the shifting.
- More shifting far from the equator, no visible shifting exactly at the equator.
- Maximum shifting at longitude 0° (and probably 180°), no shifting at + or - 90°.

The last two points seem to indicate an error in coordinate conversion.

Cheers!
BuM is offline   Reply With Quote
Old 08-06-2012, 07:54 PM   #2
pabercrombie
WW Dev. Team
 
Join Date: Sep 2010
Location: Boston, MA, USA
Posts: 325
pabercrombie is on a distinguished road
Default

This will be fixed in the 8/7 build (svn revision #709).
pabercrombie is offline   Reply With Quote
Old 01-31-2013, 05:36 AM   #3
gb96
Junior Member
 
Join Date: Aug 2009
Location: Adelaide, South Australia
Posts: 22
gb96 is on a distinguished road
Default FireSupportLine has WorldWind.CLAMP_TO_GROUND

This is a slightly different problem with the same class, FireSupportLine.

MunitionFlightPath extends FireSupportLine, however FireSupportLine:createPath() line 439 specifies WorldWind.CLAMP_TO_GROUND

This is not appropriate for MunitionFlightPath (for example representing the trajectory of a ballistic missile) since it is better to be able to see the altitude of the trajectory rather than just the path projected over the ground.

When I tried replacing CLAMP_TO_GROUND with ABSOLUTE, the MunitionFlightPath rendered correctly, however this revealed a problem with the positioning of labels (or staff comments etc) for the graphic...

TacticalGraphicUtil.placeLabelsOnPath() line 161 uses LatLon.interpolateGreatCircle() and positions the label at ground level. This is fine if the altitude mode is CLAMP_TO_GROUND but no good for ABSOLUTE since the label sits on the terrain far below the trajectory.

This can be simply fixed by instead calling Position.interpolateGreatCircle() so that the label is given the same altitude as the path.

Last edited by gb96; 01-31-2013 at 05:38 AM. Reason: punctuation was interpreted as a smiley, fixed typos
gb96 is offline   Reply With Quote
Reply

Tags
firesupportline, height, label, round, shift


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


All times are GMT +1. The time now is 10:11 PM.


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