Page 1 of 1

New Locations slider

Posted: 18.08.2007, 05:23
by dirkpitt
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

Posted: 18.08.2007, 05:52
by Cham
Dirkpitt,

please, could you tell what is the exact code change you made, in what file ?

Posted: 18.08.2007, 07:21
by LordFerret
Nice! :D

Posted: 18.08.2007, 08:47
by dirkpitt
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)

Posted: 18.08.2007, 09:36
by t00fri
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

Posted: 18.08.2007, 10:34
by dirkpitt
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".

Re: New Locations slider

Posted: 21.07.2008, 14:01
by niceguy78
Dirkpitt provided a link
Download link (Mac OS X only)

This link doesn’t work, can anyone provide a valid link.

Re: New Locations slider

Posted: 25.07.2008, 18:06
by RVS
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?

Re: New Locations slider

Posted: 27.07.2008, 12:00
by duds26
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.