[osg-users] Can't update my projection matrix amnually

Bruno Oliveira bruno.manata.oliveira at gmail.com
Thu Sep 15 09:19:06 PDT 2016


I see. That means I need to manually keep updating my near/far plane.

Is there no other way?
 - Can I manually trigger a culling traversal?
 - I know the delta in z in which I am moving my camera. Can I calculate the new near and far planes the traversal will assign after the traversal? Example: newFarValue = oldFarValue + deltaZ
 - Is the near/far plane update code centralized in some public function that I can somehow use? If not, could you please tell me where this code is so that I can reproduce it?

> On 15 Sep 2016, at 17:09, Robert Osfield <robert.osfield at gmail.com> wrote:
> 
> On 15 September 2016 at 16:57, Bruno Oliveira
> <bruno.manata.oliveira at gmail.com> wrote:
>> Hello,
>> 
>> I just verified and it is indeed related to near and far planes.
>> I am zooming my camera, and therefore, somewhere along the OSG update loops, the near and far planes will change but I don’t know what the new value is going to be.
>> 
>> I need to reproduce that in my code, as in:
>> 
>>>> camera->setViewMatrix(getInverseMatrix());
>>>> camera->setProjectionMatrixAsPerspective(...);
>> 
>> 
>> Can I somehow trigger the near/far plane recalculation?
> 
> You can't manually force a compute of the near/far planes, it happens
> as part of the cull traversal as this is where the OSG can determine
> what objects are in the view frustum and hence what values would be
> appropriate to clamp the near and far planes so all objects are
> visible.
> 
> If you don't want this computation simple switch it off as per my
> previous email.
> 
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




More information about the osg-users mailing list