Thank you Robert,
you are always clear and precise!
That's the info I need.

Gianluca

-----Messaggio originale-----
Da: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] Per conto di Robert Osfield
Inviato: lunedì 30 maggio 2011 16:50
A: OpenSceneGraph Users
Oggetto: Re: [osg-users] about the front clipping plane

Hi Gianluca,

The OSG by default will use COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES
settings for osg::Camera which tells the cull traversal to compute the
depth range of scene for each frame based on the extents of the
bounding boxes of the drawables in the scene.  Often the computed near
position will be very close to the eye point or even behind it both of
which are not usage values for settings up the projection matrix, so
the cull travesal automatically clamps the near distances if it's too
low.

The minimum near distance the OSG uses as a cut off is computed from
NearFarRatio * compute_zfar, you can reset this ratio to a lower value
via osg::Camera::setNearFarRatio(double).

Robert.

On Mon, May 30, 2011 at 3:40 PM, Gianluca Natale
<nat...@europe.altair.com> wrote:
> Hi,
>
> I have an issue with the distance of the front clipping plane of the viewing
> frustum.
>
> I mean that my scene is made only of two isolated points, each with an
> "empty" bounding box (i.e. the bb is defined as the 8 vertices coinciding
> with the point).
>
> Also, I set:
>
> setComputeNearFarMode(COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES) for my
> osg::camera, in order to have osg update automatically the front and back
> clipping planes.
>
> But sometimes it happens that the nearest point (in my scene) to the camera
> is not drawn on the screen, even if I'm sure that it is placed in front of
> the camera and not behind.
>
> It looks like the front clipping plane cuts away that point since it is too
> near the camera. Shouldn't OSG update the front clipping plane to include
> such point in the viewing volume,
>
> since it has a valid bb and it is in front of the camera?
>
> I tried to print out the zNear when this happens, and obtained values <1e-5.
>
> Also, if later I try to move the camera even nearer to that point, I see an
> error message of OSG (CullVisitor::apply(&Geode) detected NAN).
>
>
>
> So, where am I wrong?
>
> Is there any threshold to be taken into count when moving the camera near
> the nearest point my scene?
>
>
>
> Thanks,
>
> Gianluca Natale
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to