[osg-users] Trackball and view question

Christophe Medard christophe.medard at oktal.fr
Tue Sep 18 08:36:41 PDT 2007


Trackball and view questionHi,

The trackballManipulator recomputes the home position (should be called home positions in fact since there are three of them) when the scene is set on the osgViewer if you don't call TrackballManipulator::setAutoComputeHomePosition(false).

The View Matrix you'll get the first time is highly dependent of the TrackballManipulator::_homeCenter value (among others).
Since it's a lookAt Matrix that is computed, you can have the impression your point of view is the same when looking your window even if you get different values in your code (if the direction of sight is the same, unnormalized, for example).
Hope it helps,

-- 
Christophe Médard
Société OKTAL (http://www.oktal.fr)
2 impasse Boudeville
31100 Toulouse (France)
Tél. : (+33) 5 62 11 50 10
Fax : (+33) 5 62 11 50 29


----- Original Message ----- 
From: Poirier, Guillaume 
To: osg-users at lists.openscenegraph.org 
Sent: Tuesday, September 18, 2007 4:19 PM
Subject: [osg-users] Trackball and view question




Hello everyone,

I am using a SimpleViewer. I set up a post draw callback on its main camera. In it
I read the camera eye, center, and up vectors. Initially, this give me (0, 0, 0),
(0, 0, -1), and (0, 1, 0) respectively. This is what I expect and it gives me a
particular view of my scene.

Now I add a trackball manipulator to the main camera and set up the view similar
to what I had previously. When I read back the data it is quite different. I would have
expected the same camera position / orientation than before since what I see is
similar. Unless the trackball affects the model position / orientation and not just
the view ? How can I use a trackball and read back in the post draw callback the
values I want ?


sincerely,


Bill 



_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070918/4275c102/attachment-0003.htm>


More information about the osg-users mailing list