New Locations slider

Discussion forum for Celestia developers; topics may only be started by members of the developers group, but anyone can post replies.
Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

New Locations slider

Post #1by dirkpitt » 18.08.2007, 05:23

Based on this past forum discussion about location labels and importance weights,
here is a modified version of Celestia that sensibly limits the number of visible labels
while taking into account importance weights:
Download link (Mac OS X only)

Picture of Moon location labels before the fix.
Basically too many labels are showing, with disregard to importance weights:

Image

Picture of Moon after fix.
Label density = medium (only locations with large importance weight - feature size in this case - get shown)
Image

Label density = high (large and some small weighted locations are shown)
Note: number of displayed labels is computed to be proportional to the square root of the label density.

Image
Last edited by dirkpitt on 18.08.2007, 10:38, edited 1 time in total.

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #2by Cham » 18.08.2007, 05:52

Dirkpitt,

please, could you tell what is the exact code change you made, in what file ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
LordFerret M
Posts: 737
Joined: 24.08.2006
Age: 68
With us: 18 years 3 months
Location: NJ USA

Post #3by LordFerret » 18.08.2007, 07:21

Nice! :D

Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #4by dirkpitt » 18.08.2007, 08:47

I changed render.cpp.

Change this (around line 4756):

Code: Select all

             float effSize = (*iter)->getImportance();
             if (effSize < 0.0f)
                 effSize = (*iter)->getSize();
             float pixSize = effSize / (float) (cpos.distanceFromOrigin() * pixelSize);

             if (pixSize > minFeatureSize &&
                 (cpos - origin) * viewNormald > 0.0)


to this:

Code: Select all

             float effSize = (*iter)->getImportance();
             if (effSize < 0.0f)
                 effSize = (*iter)->getSize();
             float d_vis = (14.8f + 86.9f * effSize) * (float) sqrt(minFeatureSize/50.0f);

             if (cpos.distanceFromOrigin() < d_vis &&
                 (cpos - origin) * viewNormald > 0.0)

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #5by t00fri » 18.08.2007, 09:36

With this line

Code: Select all

float d_vis = (14.8f + 86.9f * effSize) * (float)


being from my least-square fit (MAPLE) of a linear dependence, d_vis = a + b * I, to a vector of importance weights (I) along with the corresponding minimal distances (d_vis(I)), where the locations with these importance weights just become visible.

DW specialized to importance weights being effective location sizes.

Here is the result of my previous analysis, comparing the fit d_vis = 14.8 + 86.9 * (importance weight) to the actual "data" points for the case of my 1600x1200 monitor.

Image

The threshold distances at which locations with a given importance weight just became visible were determined empirically and cross-checks for lower monitor resolutions were also done.

The shown results and above parameters are several years old. My commented analysis can be studied in detail e.g. in these published Maple worksheets.

Moon:
http://www.celestiaproject.net/~t00fri/images/moon_weights.pdf
Earth:
http://www.celestiaproject.net/~t00fri/earth.html

to be found in various posts of mine in the forum.

At the end of the day, my analysis depends only on ONE parameter to be adjusted according to gusto: it determines the number of labels visible at a certain reference distance. That parameter you can adjust with the above slider, as nicely illustrated in DW's images.

Bye Fridger
Image

Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #6by dirkpitt » 18.08.2007, 10:34

t00fri wrote:DW specialized to importance weights being effective location sizes.


Thanks for elaborating Fridger - actually the importance weights are indeed substituted for effSize,
unless there are no importance weights defined in the ssc (e.g., Europa, Ganymede, etc) in which case the size is used instead.
Also, in the code it still says "minFeatureSize", but that should be taken to mean "label density".

niceguy78
Posts: 1
Joined: 17.07.2008
With us: 16 years 4 months

Re: New Locations slider

Post #7by niceguy78 » 21.07.2008, 14:01

Dirkpitt provided a link
Download link (Mac OS X only)

This link doesn’t work, can anyone provide a valid link.
Jack, you can find my website here

RVS
Posts: 64
Joined: 02.11.2006
With us: 18 years
Location: Russia

Re: New Locations slider

Post #8by RVS » 25.07.2008, 18:06

Excuse me for bringing this up once again, but couldn’t slider control of visibility be extended to all kinds of labels, not just only locations?

duds26
Posts: 328
Joined: 05.02.2007
Age: 34
With us: 17 years 9 months
Location: Europe

Re: New Locations slider

Post #9by duds26 » 27.07.2008, 12:00

And it could be a good idea to let the locations slider go to the two extremes. Max: having all the labels (even if there are actually to many) and min: only see one label or none.

And an arrow on that scale where the locations are nicely balanced.
Someone could then click on it and have a nice balanced label density.


Return to “Ideas & News”