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 <[email protected]> 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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to