[osg-users] 回复: 回复: Understanding osg::CulingSet::pixelSize() andcomputePixelSizeVector()

Young 337533078 at qq.com
Sat Aug 5 01:03:12 PDT 2017

Hi Robert,
I think you are right.
I am tring to use the PIXEL_SIZE_ON_SCREEN mode of LOD, and the most important is how to get a proper piexl threshold which used in the setRange(). So I want toknow is there a method to compute the pixel of the bounding sphere without the matrix (W, P, M). 

My method is     piexlParameter = bound.radius * bound.radius * C,  and C is a empirical value.  Is there a better method?

I am looking forward to your reply.

------------------ 原始邮件 ------------------
发件人: "Robert Osfield";<robert.osfield at gmail.com>;
发送时间: 2017年7月31日(星期一) 晚上7:34
收件人: "OpenSceneGraph Users"<osg-users at lists.openscenegraph.org>; 

主题: Re: [osg-users] 回复: Understanding osg::CulingSet::pixelSize() andcomputePixelSizeVector()

Hi Young,

On 31 July 2017 at 10:19, Young <337533078 at qq.com> wrote:
Is _pixelSizeVector  meaning the ratio of space distance to screen pixel?

I don't recall off the top of my head, but looking at the code from CullingSet:

        /** Compute the pixel of an object at position v, with specified radius.*/
        float pixelSize(const Vec3& v,float radius) const { return radius/(v*_pixelSizeVector); }

The _pixelSizeVector is a set of ratio that give the size in local coordinates of a pixel in screen space projected to a given distance away from the eye point.

I'm not wording this well, it's a very long time since thought about the code - it's not a bit of the OSG discussed much, it just quietly works away doing it's job.  I've written lots of code over the years and if it works fine you really don't need to retain much knowledge about it...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170805/0b0dccc4/attachment.htm>

More information about the osg-users mailing list