Merge pull request #620 from LaurensVoerman/txt_SCREEN_COORDS

fix scale problem for osgText with characterSizeMode SCREEN_COORDS and _position set.
This commit is contained in:
OpenSceneGraph git repository 2018-09-11 11:29:36 +01:00 committed by GitHub
commit c2f0da31f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -513,7 +513,7 @@ bool TextBase::computeMatrix(osg::Matrix& matrix, osg::State* state) const
height = static_cast<value_type>(viewport->height());
}
osg::Matrix mvpw = rotate_matrix * modelview * projection * osg::Matrix::scale(width/2.0, height/2.0, 1.0);
osg::Matrix mvpw = rotate_matrix * osg::Matrix::translate(_position) * modelview * projection * osg::Matrix::scale(width/2.0, height/2.0, 1.0);
osg::Vec3d origin = osg::Vec3d(0.0, 0.0, 0.0) * mvpw;
osg::Vec3d left = osg::Vec3d(1.0, 0.0, 0.0) * mvpw - origin;