[osg-users] setProjectionMatrixAsPerspective changes eyepoint when camera is rotated
Mike Greene
mgreene at hiwaay.net
Thu Oct 22 12:00:28 PDT 2015
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
More information about the osg-users
mailing list