[osg-users] Positioning the camera

7 views
Skip to first unread message

michael kapelko

unread,
Nov 15, 2012, 10:17:54 AM11/15/12
to OpenSceneGraph Users
Hi.
I have default viewer without any special manipulator specified. I try to setViewMatrix for camera to position it, but it doesn't work.
It needs to be run from Data directory.

Am I doing it wrong?

Christian Buchner

unread,
Nov 15, 2012, 11:48:36 AM11/15/12
to OpenSceneGraph Users

You're trying to set the view matrix on the camera which may get overwritten by the camera manipulator at the beginning of each frame. Instead, check your camera manipulator (e.g. TrackballManipulator) if it has a member function that accepts a view matrix.

Some camera manipulators (like the Terrain manipilator) keep a center position, a distance and an Euler angle with respect to the center. Setting these values might work, while setting the view matrix directly may not work.

Also in the beginning the camera manipulators compute a default home position and use it. Make sure you apply your own view matrix at a later point in time.

Christian


2012/11/15 michael kapelko <kor...@gmail.com>
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Reply all
Reply to author
Forward
0 new messages