[osg-users] setViewMatrixAsLookAt where is center?

Peter Wraae Marino osghelp at gmail.com
Sat Jul 26 08:54:21 PDT 2008

Hi Ariasgore,

are you sure you want a up vector 0,1,0 ? osg uses z up 0,0,1
but of course if you have changed the coordinate system then it's ok.

my two cents,

On Sat, Jul 26, 2008 at 5:04 PM, Ariasgore <ariasgore at gmx.de> wrote:

> Hello,
> I was trying to use the setViewMatrixAsLookAt matrix like I would use
> gluLookAt (since they are similar), my intention is to create a rotation
> around a point. So first I selected the eye position which should be
> (0,-25,25)  and wanted to point the camera towards (0,0,0) where my object
> is placed, so basically the code looks like this:
> viewer.getCamera()->setViewMatrixAsLookAt(osg::Vec3(0,-25,25),
> osg::Vec3(0,0,0), osg::Vec3(0,1,0) );
> but rendering this scene creates some confusing perspective, the position
> of the camera seems right but even if I am looking at (0,0,0) the object I
> am looking at is at the top of the screen and not centered, as I supposed.
> While placing the object at scene's origin, shouldn't this setup center
> this object since I am looking at (0,0,0) ?
> Greetings
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080726/81d76dbb/attachment-0003.htm>

More information about the osg-users mailing list