Re: [osg-users] A suspicious bug of MatrixD

2014-04-18 Thread Robert Osfield
HI Tianlan, On 17 April 2014 23:04, Tianlan Shao shaotianlan...@gmail.com wrote: I still have doubt about the interpretion of the experiment: ...so we'd expect the scale of the x and y axis to be swapped.. I think that means, after rotation, the scale is still represented in the original

Re: [osg-users] A suspicious bug of MatrixD

2014-04-18 Thread Jolley, Thomas P
the getScale function? Tom Jolley -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Friday, April 18, 2014 2:06 AM To: OpenSceneGraph Users Subject: Re: [osg-users] A suspicious

Re: [osg-users] A suspicious bug of MatrixD

2014-04-18 Thread Sebastian Messerschmidt
...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Friday, April 18, 2014 2:06 AM To: OpenSceneGraph Users Subject: Re: [osg-users] A suspicious bug of MatrixD HI Tianlan, On 17 April 2014 23:04, Tianlan Shao shaotianlan...@gmail.com wrote: I still have doubt about the interpretion of the experiment

Re: [osg-users] A suspicious bug of MatrixD

2014-04-18 Thread Tianlan Shao
, April 18, 2014 2:06 AM To: OpenSceneGraph Users Subject: Re: [osg-users] A suspicious bug of MatrixD HI Tianlan, On 17 April 2014 23:04, Tianlan Shao shaotianlan...@gmail.com wrote: I still have doubt about the interpretion of the experiment: ...so we'd expect the scale of the x and y

Re: [osg-users] A suspicious bug of MatrixD

2014-04-18 Thread Robert Osfield
Hi Tom, On 18 April 2014 15:27, Jolley, Thomas P thomas.p.jol...@boeing.com wrote: Hi Robert, I think Tianlan may be correct about the getScale function. Here's why: The osg Matrix class was written as row major ordering (layout in memory is column major so it works with OpenGl). OSG

Re: [osg-users] A suspicious bug of MatrixD

2014-04-17 Thread Robert Osfield
Hi Tianlan, Could you provide a small example that illustrates the problem? I did a quick test of: osg::Matrixd matrix = osg::Matrixd::scale(3.0,4.0,1.0); OSG_NOTICEMatrixd.getScale() = matrix.getScale()std::endl; And this works. I will need to have a think about a more

Re: [osg-users] A suspicious bug of MatrixD

2014-04-17 Thread Tianlan Shao
Dear Robert, thank you for your reply, below is the code to reproduce the bug: // osg::Matrixd S = osg::Matrixd::scale(3.0, 4.0, 5.0); osg::Matrixd R = osg::Matrixd::rotate(osg::Quat(0.1, 0.5, 0.6, 0.7)); osg::Matrixd T =

Re: [osg-users] A suspicious bug of MatrixD

2014-04-17 Thread Robert Osfield
Hi Tianlan, I have done the following test where I provide a non unifom scale matrix then rotate it by 90 degrees, and then output the result of getScale() and the result of you suggested above: osg::Matrixd scale_then_rotated =

Re: [osg-users] A suspicious bug of MatrixD

2014-04-17 Thread Tianlan Shao
Dear Robert, thank you very much for your time. I still have doubt about the interpretion of the experiment: ...so we'd expect the scale of the x and y axis to be swapped.. I think that means, after rotation, the scale is still represented in the original frame, instead of the rotated one

Re: [osg-users] A suspicious bug of MatrixD

2014-04-17 Thread Tianlan Shao
Dear Robert, I'd like to add that, when the x, y, and z scale factors are identical, the current getScale() gives the same result as the newly proposed one. I guess that's the reason why this issue was not reported before. Thank you very much. Best regards, Tianlan Shao On Fri, Apr 18, 2014 at

[osg-users] A suspicious bug of MatrixD

2014-04-15 Thread Tianlan Shao
Dear all, The following code in the header file MatrixD looks very suspicious to me: inline Vec3d getScale() const { Vec3d x_vec(_mat[0][0],_mat[1][0],_mat[2][0]); Vec3d y_vec(_mat[0][1],_mat[1][1],_mat[2][1]); Vec3d z_vec(_mat[0][2],_mat[1][2],_mat[2][2]);