PDA

View Full Version : Simulating a lot of moving symbols?


vhoriks
04-18-2012, 03:26 PM
Hello everyone

I would like to do a test on how well WorldWind handles a lot of moving symbols. I would appreciate general pointers on how to write a piece of code to do that, or even if anyone feels tempted to write some code by themselves.

nlneilson
04-18-2012, 07:13 PM
Well it's not the code but the concept that may help you the most.

I recorded a GPS track in my car.
Then with a python script 50 tracks offsetting the original as to position and altitude.

http://www.nlneilson.com/wwposts/50_tracks.jpg
This is being updated every second.

I just use points but you can try symbols to see how fast CPU goes up.
I use C++ for sorting and heavy lifting and use a socket to communicate with the Java WWJ for display.

The code is proprietary.

tag
04-19-2012, 05:33 PM
Modify one of the programs in the performance package to continually update the shapes. Or easier yet, just run one of those programs, bring up the WW dashboard (Ctl+Alt+Shift+left-click) check the box labelled "Run Continuously" and look at the statistics in the Performance panel.

vhoriks
05-04-2012, 02:16 PM
Here's some follow up.

I took the 'PointPlacemarksEverywhere' example from the package 'performance' and modified it a bit. The resulting code is available here: http://pastebin.com/47qt1Vdz

It's really enough to just insert placemarks to test worldwind's performance, but if the boss wants moving symbols he's gonna get moving symbols. :)

Some input regarding this code would be much appreciated. Is there anything that can be done better? One thing I've thought about is the actual graphic (the pushpin) used, maybe it could be replaced with a more basic symbol, like just a dot or a cross?

heidtmare
05-04-2012, 02:47 PM
u could use setUsePointAsDefaultImage(true)

http://builds.worldwind.arc.nasa.gov/worldwind-releases/1.2/docs/api/gov/nasa/worldwind/render/PointPlacemarkAttributes.html#setUsePoin tAsDefaultImage(boolean)

vhoriks
05-07-2012, 07:15 AM
u could use setUsePointAsDefaultImage(true)

http://builds.worldwind.arc.nasa.gov...Image(bo olean)

Thanks for your advice heidtmare, you were correct, changing the rendered graphic indeed caused a change in performance. Rendering 50000 pushpin graphics resulted in an fps of 3, 50000 plain white dots gave an fps of 5.

Hm, as a sidenote I observed something that's seemingly in conflict with the documentation. The documentation says this regarding the attribute usePointAsDefaultImage in PointPlacemarkAttributes.
setUsePointAsDefaultImage
public void setUsePointAsDefaultImage(boolean usePointAsDefaultImage)Specifies whether to draw a point when the current source image is null. When drawing the point, the scale of the currently active attributes specifies the diameter of the point in pixels. The point is drawn in the line color of the currently active attributes.

Parameters:
usePointAsDefaultImage - true to draw a point when the current source image is null, otherwise false.

I changed the default value of this boolean in the code for the class, from false to true. Regardless of the value of DEFAULT_IMAGE_PATH the rendered graphics became a dot, even though default image path wasn't null. Perhaps I misunderstand the meaning of "current source image" but my assumption was that it's the same as DEFAULT_IMAGE_PATH in this situation.