Hi julio,
I guess you are not looking for culling, but for near-far plane calculation.
try:
camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
why do you want to disable culling, or did you just mixed it up with the
near-far mode?
cheers
Sebastian
I am get a lot of frustration trying to disable frustum culling with
OSG camera.
I am setting the perspective matrix to a near plane of 0.1 and a far
plane of 1000.0
here is my code.
I explicitly disable frustum culling, however no matter how many time
I do it, each time
viewer.frame() is called, the camera rest the near plane to 0.112 and
the far plane to 228.56
can someone tells me how to prevent OSG from doing that?
here is my setup code that initialize the camera after the viewer is
instantiated.
SetCameraProjectionMatrix (viewer, 90.0f, dFloat
(width) / height, 0.1, 1000.0f);
int cullingMode = cam->getCullingMode();
cullingMode &= ~osg::CullSettings::VIEW_FRUSTUM_CULLING;
cam->setCullingMode(cullingMode);
}
void SetCameraProjectionMatrix (osgViewer::Viewer& viewer, dFloat
viewAngleInDegress, dFloat aspectRatio, dFloat nearPlane, dFloat farPlane)
{
osg::Camera* const camera = viewer.getCamera();
camera->setProjectionMatrixAsPerspective (viewAngleInDegress,
aspectRatio, nearPlane, farPlane);
// camera->setViewMatrixAsLookAt (osg::Vec3 (3.0f, -5.0f, 2.0f),
osg::Vec3 (0.0f, 0.0f, 0.0f), osg::Vec3 (0.0f, 0.0f, 1.0f));
camera->setViewMatrixAsLookAt (osg::Vec3 (-3.0f, -5.0f, 2.0f),
osg::Vec3 (0.0f, 0.0f, 2.0f), osg::Vec3 (0.0f, 0.0f, 1.0f));
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org