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 view
matrix translates the world coordinates into the eye coordinates, and
eye coordinates are +ve X to the right, +ve Y up, +veZ out from the
screen.  While in vis-sim the convention is that world coordinates of
the scene have +ve X to the east, +ve Y north +ve Z up.   Please note
that the scene is in world coordinates, and the view matrix transforms
the world cooridnates into eye coordinates, the view matrix doesn't
position the eye into the scene but the other way around - this is
important as it's the inverse matrix of a matrix that positions an
object in the scene in world coordinates.  This later point is
probably where you have gone wrong.

I won't dive in any further as teaching users about maths is not my
role - I have plenty of other work to do.  Please spend some time
looking into the background maths, there are a huge number of articles
on the web and posts on osg-users over the years.

Robert.

On Wed, Jun 8, 2011 at 9:59 AM, Diana Kittelmann
<[email protected]> 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, x, y, z);
>
>   osg::Vec3 pos(x, y, z);
>   osg::Matrixd matrix;
>   matrix.setRotate(osg::Quat(osg::DegreesToRadians(0.0), osg::X_AXIS, 
> osg::DegreesToRadians(0.0), osg::Y_AXIS, osg::DegreesToRadians(0.0), 
> osg::Z_AXIS));
>   matrix.setTrans(pos);
>   viewer.getCamera();
>   viewer.frame();
> }
>
> But I'm not sure if this is right.
>
> Diana
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=40200#40200
>
>
>
>
>
> _______________________________________________
> 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