Re: [osg-users] Setting up a camera

2011-06-08 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
t; loop and place it in an UpdateCallback... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Diana Kittelmann Sent: Wednesday, June 08, 2011 2:59 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-

Re: [osg-users] Setting up a camera

2011-06-08 Thread Tom Pearce
Hi Diana, I find it pretty convenient to use Code: getCamera()->setViewMatrixAsLookAt (const osg::Vec3 &eye, const osg::Vec3 ¢er, const osg::Vec3 &up) for setting up the view matrix, it was one of Robert's suggestions but I thought I'd re-emphasize it. Vec3 "eye" will be the position you're

Re: [osg-users] Setting up a camera

2011-06-08 Thread Diana Kittelmann
Thanks alot Robert. I try to teach me some math on my own now, but your answers were really helpful. @ulrich I did include I just missed to write it in my Post. Diana -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40207#40207 __

Re: [osg-users] Setting up a camera

2011-06-08 Thread Ulrich Hertlein
On 8/06/11 10:59 , Diana Kittelmann wrote: > Yeah, I'm just seeing the blue background. And yaeh im struggeling with the > math to set up my matrix. > > I set it up like this: > > while(!viewer.done()) > { >osg::EllipsoidModel convert; >convert.convertLatLonHeightToXYZ(lat, lon, height,

Re: [osg-users] Setting up a camera

2011-06-08 Thread Robert Osfield
Hi Diana, I'm afraid I don't have the time to write up a full tutorual on maths of setting view matrixes and matrix maths, the topic has been covered lots of time by the community so I'd recommend you have a look through the archhives. As a quite note, I'd mention that in OpenGL and the OSG the v

Re: [osg-users] Setting up a camera

2011-06-08 Thread Diana Kittelmann
Yeah, I'm just seeing the blue background. And yaeh im struggeling with the math to set up my matrix. I set it up like this: while(!viewer.done()) { osg::EllipsoidModel convert; convert.convertLatLonHeightToXYZ(lat, lon, height, x, y, z); osg::Vec3 pos(x, y, z); osg::Matrixd matrix

Re: [osg-users] Setting up a camera

2011-06-08 Thread Robert Osfield
Hi Diana, On Wed, Jun 8, 2011 at 9:29 AM, Diana Kittelmann wrote: > it doesen't display my scene. viewer.run() works fine. What do you mean, doesn't display your scene. What do you see? Just the default blue backgroud? Did you set your view matrix to look at the scene? If you don't have a ca

Re: [osg-users] Setting up a camera

2011-06-08 Thread Diana Kittelmann
Thanks Robert, but when I try viewer.setSceneData(loadedModel); viewer.realize(); while(!viewer.done()) { ... viewer.frame(); } it doesen't display my scene. viewer.run() works fine. Diana. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=4

Re: [osg-users] Setting up a camera

2011-06-08 Thread Robert Osfield
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 manipualt

[osg-users] Setting up a camera

2011-06-08 Thread Diana Kittelmann
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 he