Hi Allan,

Do you want use the standard camera manipualators but with a set home
position, or are you looking for completely custom management of the
camera's view position?  If you want the later than you'll want to not
bother with any camera manipualtor and just set the viewer's master
camera's on each frame i.e


  while(!viewer.done())
  {
      viewer.getCamera()->setViewMatrixAsLookAt(eye, center, up);
      viewer.frame();
  }

Wheras to set the home position of camera manipulator you do:

   viewer.getCameraManipulator()->setHomePosition(eye,center,up);

And then to move to the home position call:

   viewer.home();

Robert.

Robert.

On Wed, Nov 5, 2008 at 10:03 PM, Allen <[EMAIL PROTECTED]> wrote:
> Hi, I'm new to OSG and am in need of assistance with how to position a
> camera in a scene.  I am using OSG 2.6.1 on linux (centos4). Here's my
> setting: 1) I've setup my scene (only one node - terrain). 2) I've setup my
> 1 and only 1 camera in my only viewer by calling:
> setProjectionMatrixAsPerspective ( 30.0f, static_cast<double> ( width )
> /static_cast<double> ( height ), 1.0f, 10000.0f );
> 3) I CAN add a slave camera & translate it in ONLY the x & y planes.  I can
> scale too but this still is not what I'm looking for.
>
> My Question:  How to I get my Camera to be positioned at a certain spot over
> my terrain and looking at a particular spot on my terrain?  For the life of
> me, I can't figure this out & I"ve been pouring through dozens of examples,
> the API, and trying all sorts of experiments with EVERY camera method I can
> find, view & viewer method I can find that might help me.
>
> Thx everyone for your help.  I really appreciate this.
>
> --
> Sincerely, Allen
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to