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_NOTICE<<"Matrixd.getScale() = "<<matrix.getScale()<<std::endl;
And this works. I will need to have a think about a more complex
scale set up before I can judge what it should be.
Robert.
On 15 April 2014 16:43, Tianlan Shao <[email protected]> wrote:
> 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]);
> return Vec3d(x_vec.length(), y_vec.length(), z_vec.length());
> }
>
> Shouldn't the index order be the other way around? I mean it should be
>
> inline Vec3d getScale() const {
> Vec3d x_vec(_mat[0][0],_mat[0][1],_mat[0][2]);
> Vec3d y_vec(_mat[1][0],_mat[1][1],_mat[1][2]);
> Vec3d z_vec(_mat[2][0],_mat[2][1],_mat[2][2]);
> return Vec3d(x_vec.length(), y_vec.length(), z_vec.length());
> }
>
> The behaviour of my program was strange before I fix this problem. I'm not
> 100% percent sure, but since it's of fundamental importance, I still decided
> to report.
>
> Best regards,
> Tianlan Shao
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org