Hi Fredric,

Could it be that the OSG's being row major rather than column major is
the problem?  Try transposing your matrix values before passing to the
OSG.  OpenGL docs and spec are set out in column major, although the
memory is laid in row major...

Robert.

On 12/12/06, Frédéric SPEISSER <[EMAIL PROTECTED]> wrote:
Robert Osfield wrote:
> Hi Federic,
>
> On 12/12/06, Frédéric SPEISSER <[EMAIL PROTECTED]> wrote:
>> 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 ?
>
> OK I'm still lost.  The OSG will support you setting your own
> projection matrix without the nedd to use setProjectionMatrixAsOthro
> or setProjectionMatrixAsFrustum.  However, the projection matrix
> should just contain the projection, it shouldn't contain parts of the
> view matrix, i.e. rotation etc.  Is that you are accumulating a bit of
> what should be a view matrix into the projection matrix?
>
> Robert.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
Ok, excuse me if I'm not very clear.
I'm not accumulating (I hope not, I will make further tests) view and
projection matrix in one matrix since I'm breaking up the "projection"
matrix I use into two matrix :
One, in correspondence to the intrinsic parameters of the camera : a
projection matrix described as follow :
u  0  u0  0
0  v  v0  0
0  0  1   0
0  0  0   1

that I set through
_viewer->getSceneView()->setProjectionMatrix(intrinsicMat);  _viewer is
an instance of osgViewer::SimpleViewer.

The other, in correspondence to the extrinsic parameters of the camera :
a modelview matrix described as follow :
r11  r12  r13  tx
r21  r22  r23  ty
r31  r32  r33  tz
0     0      0      1

that I set through
_viewer->getCameraManipulator()->setByMatrix(extrinsicMat);  _viewer is
an instance of osgViewer::SimpleViewer.

I keep testing...
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/

Reply via email to