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 09-17-2009, 03:10 PM   #1
Syris3000
Junior Member Extraordinaire
 
Join Date: Jan 2009
Location: Arlington, VA
Posts: 82
Syris3000 is on a distinguished road
Default Dotted/Hashed Polylines?

Anyone know if dotted lines are supported, or do i need to extend the polyline class and create my own?
Syris3000 is offline   Reply With Quote
Old 09-17-2009, 03:36 PM   #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

Polyline and SurfacePolyline do support stippling. See setStippleFactor() and setStipplePattern().
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 09-17-2009, 07:04 PM   #3
Syris3000
Junior Member Extraordinaire
 
Join Date: Jan 2009
Location: Arlington, VA
Posts: 82
Syris3000 is on a distinguished road
Default

So that works, but when i zoom in closer to the line the stippling stops and the line becomes solid... am i doing something wrong?

RenderableLayer tracksLayer = new RenderableLayer();
gisEditor.insertBeforePlacenames(tracksL ayer);
Polyline p = new Polyline();
p.setStippleFactor(3);
p.setStipplePattern((short)0xAAAA);
gov.nasa.worldwind.geom.Angle a = gov.nasa.worldwind.geom.Angle.fromDegree s(0);
gov.nasa.worldwind.geom.Angle b = gov.nasa.worldwind.geom.Angle.fromDegree s(5);
List<LatLon> ll = new ArrayList<LatLon>();
ll.add(new LatLon(a,a));
ll.add(new LatLon(b,b));
p.setPositions(ll, 1000);
tracksLayer.addRenderable(p);
Syris3000 is offline   Reply With Quote
Old 09-17-2009, 07:38 PM   #4
Syris3000
Junior Member Extraordinaire
 
Join Date: Jan 2009
Location: Arlington, VA
Posts: 82
Syris3000 is on a distinguished road
Default

And the performance is really bad... when i add the stippled polyline zooming and moving around are slowed significantly.
=
Syris3000 is offline   Reply With Quote
Old 09-17-2009, 10:09 PM   #5
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

I tried you code in the context of an ApplicationTemplate subclass and it works as expected. The stippling patterns stays the same at all zoom levels. When getting very close to the line it ends up being clipped by the near plane, but that's expected too.

Try to test this code in a simple app first to see whether it works properly before integrating it to your project.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 09-18-2009, 02:26 PM   #6
Syris3000
Junior Member Extraordinaire
 
Join Date: Jan 2009
Location: Arlington, VA
Posts: 82
Syris3000 is on a distinguished road
Default

I'm sorry, i made a stupid mistake.... that was inside of a method being called repetitively so it was creating a new layer every time. This explains why the performance was so bad and the line didn't look dotted anymore. I feel stupid now
Syris3000 is offline   Reply With Quote
Old 09-18-2009, 04:51 PM   #7
Syris3000
Junior Member Extraordinaire
 
Join Date: Jan 2009
Location: Arlington, VA
Posts: 82
Syris3000 is on a distinguished road
Default

So I am still having some issues though.... My polyline has way to many points for the stipple to work correctly. B/c i want to line to have smooth curves i have a lot of points and it is trying to stipple between the points, which isnt very much room.
Any other ideas?
Syris3000 is offline   Reply With Quote
Old 09-19-2009, 12:36 AM   #8
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

Can you post a screenshot?
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Reply

Tags
dotted, hashed, polylines


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
drawing a million polylines laoballer Development Help 15 11-24-2009 01:54 PM
How to make polylines and points drawn on top of BlueMarble layers... swingkid Development Help 3 09-06-2008 06:24 PM
Broken Polylines maltaweel Development Help 4 06-07-2008 04:38 AM
Polylines are too slow... adrianboimvaser Development Help 9 12-18-2007 02:54 PM
Antialiased polylines maemigh Development Help 4 08-22-2007 02:25 PM


All times are GMT +1. The time now is 08:25 AM.


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