[osg-users] setProjectionMatrixAsPerspective changes eyepoint when camera is rotated
Sebastian Messerschmidt
sebastian.messerschmidt at gmx.de
Thu Oct 22 12:09:30 PDT 2015
Hi Mike,
Where and when are you updating the projection?
Also you can hook into the near-far computation callback to modify the
calculated values.
Cheers
Sebastian
> Hi,
>
> I am trying to manually effect near and far clipping planes based on camera altitude in my app. Essentially, I do this:
>
> Camera()->getProjectionMatrixAsPerspective(_fov,_ratio,_near,_far);
>
> Then based on some criteria, I might change the near or far clip planes.
>
> _near = _nearNew;
> _far - _farNew;
>
> I then try to reset using
>
> Camera()->setProjectionMatrixAsPerspective(_fov,_ratio,_nearNew,_farNew);
>
> which works fine IF the original camera is not rotated, However, if the camera is rotated by, say , 90 degrees, prior to the calls, then the view after the get/set combo moves the eyepoint down by a factor equal to the aspect ratio of the screen.
>
> Thank you!
>
> Cheers,
> Mike
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65410#65410
>
>
>
>
>
> _______________________________________________
> 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