Thanks Robert,

This is an odd corner-case I guess, I want the LODs to be selected
based upon global distance from the eye-point.  For various reasons,
onscreen size is inappropriate as a selector.  I think I can put
together a small example/patch and send it in for review.


Sean Spicer
Executive Vice President & Chief Technology Officer
Aqumin (

On Fri, Oct 9, 2009 at 2:06 AM, Robert Osfield <> wrote:
> Hi Sean,
> You are correct the range distance of LOD's are in the LOD's own local
> co-coordinate system.  This is appropriate as you almost aways want
> LOD's to scale relative to a screen size, and doing the calc in local
> coordinate allows you to decorate subgraphs with LOD's with transforms
> that scale up or down the subgraph and still have the LOD ranges
> computed appropriate for that new scaling.  This behavior is key to
> get a scene graph to be well encapsulated.
> It sounds like in your case you have transforms above your LOD's that
> scale your objects, but you still want their ranges to set in world
> coords, that ignore any transforms.  This would present the problem
> that is the transforms scale change then the LOD would choose
> different children - choosing an in-apprioriate level of detail for
> the on screen size.
> Robert.
> On Fri, Oct 9, 2009 at 5:21 AM, Sean Spicer <> wrote:
>> Studying the source a bit harder, I think the range-distance is
>> definitely in Object (local) coordinate.  The distance calculation
>> (osg::LOD.cpp) is:
>> required_range = nv.getDistanceToViewPoint(getCenter(),true);
>> where getDistanceToViewPoint is (osgUtil::CullVisitor.cpp)
>> (pos-getViewPointLocal()).length()*getLODScale();
>> So, this raises the question: is there a good reason why there is no
>> option to specify the LOD range distance in World Coordinates?  This
>> would make complex LOD graphs like the one I'm working on much, much
>> simpler.  Perhaps there is another method that I just do not see?
>> cheers,
>> sean
>> On Thu, Oct 8, 2009 at 10:50 PM, Sean Spicer <> wrote:
>>> This may be a simple question - is the LOD range distance specified in 
>>> object or world coordinates?  I seems as if it should be in world 
>>> coordinates, but I've got an example with numerous LOD nodes in sub-graphs, 
>>> and if I sent a constant distance range in each of them (0.0, 30.0f) so 
>>> that each LOD node has the same range - the LOD switch only behaves as 
>>> expected if the transforms above each LOD node are identical.  The moment I 
>>> have a scale matrix above the LOD the switch becomes dependent on the 
>>> scaling...e.g. larger LODs switch before smaller ones.  This leads me to 
>>> think that the LOD range distance is in object coordinates, and needs to be 
>>> scaled by the localToWorld transform.
>>> I've had a look at the source, and it seems logical (not to mention that 
>>> I'd be shocked if someone hadn't had a problem before this if it were 
>>> incorrect)  Comments?  Thoughts?
>>> cheers,
>>> sean
>> _______________________________________________
>> osg-users mailing list
> _______________________________________________
> osg-users mailing list
osg-users mailing list

Reply via email to