HI Ryan,

It's the CameraManipulator that will be setting the view matrix per
frame, and it is what is using the bounding volume of the scene graph
to set it's initial position.  If you have a camera manipulator
attached to the viewer on end of each update traversal the view matrix
from the camera manipulator will be copied to the camera's view matrix
overwritting what you are setting manually, unless you do it after the
updateTraversal() (note frame() encompasses advance();
eventTraversal();updateTraversal();renderinTraversals());

If you want to use Camera::setViewerMatrix*() methods then you to need
to create your viewer without attached a CameraManipulator, and by
default this is what the viewer does unless you call viewer.run() as
viewer.run() has a fallback of attaching a TrackballManipulator is
nothing else is setting the camera viewer matrix.  If you call
viewer.realize() and run the frame loop yourself then you won't get
this auto added camera manipulator.

My guess is that you still might be happy using the CameraManipulator
if only it didn't use the whole bounding sphere.   For this you can
just use:

  viewer.getCameraManipualtor()->setHomePosition(eye, look, up);

But you'll need to call this after the setSceneData() as this it'll be
the setSceneData() that is prompting the camera manipulator to do it's
stuff.

You follow up email about setUpViewerAsEmbeded() is just a
distraction, it's not related to the problem in hand.

Robert.

On Thu, Dec 18, 2008 at 1:01 AM, Ryan Morris <russell.co...@gmail.com> wrote:
> I understand that positioning the camera SHOULD fix my problem, but it
> isn't. I have the light positioned at (0,0,100,1) and even after i set my
> camera with setViewMatrixAsLookAt it is still trying to view the entire
> bounding box of the scene. This is the fix i was looking for when i started
> the post =) Looking forward to some guidance! Thanks!
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to