Hi Andy,

On 11/17/06, Andy Preece <[EMAIL PROTECTED]> wrote:
> Which version of the OSG are your using?

Still on 1.1 while I learn my way.

Move up to 1.2, its contains bug fixes, new examples, new features.

> Its simply the cull traversal is finding an empty scene so unable to
set the near and far sensibly.

I figured as much from looking at the osg::source code. I was hoping to
disable this feature (to make it more Performer like, I confess :-)).

You can disable the feature, and you already have...??

> Errrh the setComputeNearFarMode you used above switches off the auto
compute... :)

Good. That is what I was hoping it would do.

> To set the near and far you simple use the
SceneView::setProjectionMatrix*() methods.

OK. I am calling this method already but the near/far values are NOT
being set in the CullVisitor when I have switched off the auto near/far
compute.

After some additional experimentation I have found that the following
code fixes the problem, if it is called after the setProjectionMatrix*()
call.

osgUtil::CullVisitor *cv = m_SceneView -> getCullVisitor() ;
osgUtil::CullVisitor::value_type znear = -1.0 ;
osgUtil::CullVisitor::value_type zfar  = 1.0 ;
cv -> clampProjectionMatrix( m_SceneView -> getProjectionMatrix(),
znear, zfar ) ;

It looks to me as if clampProjectionMatrix() needs to be called if the
auto compute is turned off in order for the clip planes to be set
correctly. Do you agree?

When the autocompute is off clampProjectionMatix shouldn't need to be
called, the near and far will come entirely from the projection
matrix.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to