Hi Robert,
First of all, thank for your response.
I use a matrix described as : m11 m12 m13 m14 which is a perspective
matrix, it's true,
m21 m22 m23 m24
m31 m32 m33 m34
0 0 0 1
but it is not described with the openGL usual variables (left ,right,
bottom, top, near, far).
Indeed, does manipulator (especially trackball) behave properly when the
projection matrix is set through a matrix directly (like above , and not
set through
"setProjectionMatrixAsOrtho" or "setProjectionMatrixAsFrustum" ?
And when I set the projection like this, is it normal that in rotation
manipulation the object does not rotate properly (the camera around the
object actually since we're using a camera manipulator) ? Am I making
an incorrect use of the TrackBall ?
Thank you.
Fred.
Robert Osfield wrote:
Hi Fred,
I'm pretty lost in what exactly you are trying to do. What type of
projection matrix are you trying to use? The two basic classes of
projection matrix are perspective or orthographic, I haven't yet come
across an app that doesn't use one of these.
As for which way is up, the osgGA manipulators all assume Z is up, as
do the loaders.
Robert.
On 12/11/06, Frédéric SPEISSER <[EMAIL PROTECTED]> wrote:
Hi all,
Sorry if my problem is obvious..
I'm currently trying to integrate a trackball manipulator in my
application but I encounter problem especially with the rotation
(problem of point of view ?)
I'm using osgViewer::SimpleViewer since I'm working with QT.
I overloaded the SimpleViewer class since I'm must set manually my
projection matrix. The only method I overloded is the
frameUpdateTraversal() method, in order to be able to use a manually set
projection matrix (and not a perspective or orthographic one).
I integrate the trackball manipulator through my simple viewer.
But when I try to pan my loaded model, it works but the Y and Z axis are
inverted (problem that I already saw since the up direction is different
since you're working with manipulator or not, isn't it ?). The main
problem is the rotation, when I try to rotate my model it is rotated
around the camera? but not around the center of it as expected...
I try to use the trackball manipulator without setting my projection
matrix (leaving the defaults settings of the manipulator) and it works
properly.
How could I set my trackball manipulator in order that it works properly
with my projection matrix too ?
Here the code that I use :
_viewer = *new* MySimpleViewer;
QObject::*connect*(*this*, *SIGNAL*(updateSignal()), *this*,
*SLOT*(updateGL()));
*connect*(&_timer, *SIGNAL*(timeout()), *this*, *SLOT*(updateGL()));
_timer.start(10);
..........
_viewer->setSceneData(_root);
_viewer->setCameraManipulator(*new* osgGA::TrackballManipulator);
...........
static int firstFrame=0;
*if* (!firstFrame){
_viewer->init();
_viewer->getCameraManipulator()->setByMatrix(extrinsicMat); //
extrinsicMat is the modelview matrix
firstFrame++;}
_viewer->frameAdvance();
_viewer->frameEventTraversal();
_viewer->getSceneView()->setProjectionMatrix(intrinsicMat); //
intrinsicMat is the projection matrix -- my projection matrix is
(intrinsicMat * extrinsicMat)
_viewer->frameUpdateTraversal();
_viewer->frameCullTraversal();
_viewer->frameDrawTraversal();
.......
Is there any operation to make with the modelview matrix (extrinsicMat)
before setting it in the manipulator ?
Any response or clue are wellcome.
Thank you.
Fred.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/