Hi Diana,

If you are controlling the camera from a user defined path or
simulation then you are best to not attach a camera manipulator to the
viewer and just set the viewer's master camera directly yourself.  If
you do try to set the camera's view matrix yourself but still have a
camera manipualtor attached the value you set will be overwritten.
The osgViewer::Viewer by default will not attach a camera manipulator,
but if you call viewer.run() it will know assume there isn't anything
else settings the view matrix so will attach a camera manipulator as a
fallback to at least provide some interactive view.

For your own app I'd expect something like:

  osgViewer::Viewer viewer;
  viewer.setSceneDat(mySceneGraph);
  viewer.realize();
  while(!viewer.done())
  {
     viewer.getCamera()->setViewMatrix(myViewMatrix); // or use
setViewMatrixAsLookAt(..)
      viewer.frame();
  }


Robert.

On Wed, Jun 8, 2011 at 8:38 AM, Diana Kittelmann
<[email protected]> wrote:
> Hi,
>
> I'm trying to write something like a flightsimulator for simulating a sensor. 
> For this I have some world data for my scene.
>
> Now I'm trying to create a camera. But the camera doesen't look to where I 
> want it to look at. I get the following values
>
> - the position in lat[deg], lon[deg] and height[meter]
> - the orientation in pitch, roll and yawn in [rad]
> - the field of view in [rad] splittedt in fov_x_begin, fov_x_end etc
> - the distance sensing in [meter]
>
> from a server. Position and orientation are changing constantly, but first of 
> all I would be happy if I get the right view with some default values.
>
> I tried it with setViewMatrix() and setHomePosition() but nothing happens. 
> Maybe I used it wrong but maybe someone can tell me how I have to realize it.
>
> Im using osg 2.8.1 with vc8. The camera coordinate have to be with positive 
> z-Axis as the camera view, +y-Axis up and +x-axis to the left.
>
>
> Thank you!
>
> Cheers,
> Diana
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=40190#40190
>
>
>
>
>
> _______________________________________________
> 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