Mercurial > mplayer.hg
comparison libass/ass_render.c @ 23322:bc9ec60e174d
Revert y-axis rotation. Change order of rotations.
Now rotations are performed in the following order: X, Y, Z. Before this, it
was the other way around. Also, in FreeType Y axis is directed upwards, so the
corresponding rotation must be reverted.
author | eugeni |
---|---|
date | Fri, 18 May 2007 18:58:34 +0000 |
parents | 04dbd42b3962 |
children | 99ac5d381aed |
comparison
equal
deleted
inserted
replaced
23321:ab8f2f9afd51 | 23322:bc9ec60e174d |
---|---|
1668 * \param frz z-axis rotation angle | 1668 * \param frz z-axis rotation angle |
1669 * Rotates both glyphs by frx, fry and frz. Shift vector is added before rotation and subtracted after it. | 1669 * Rotates both glyphs by frx, fry and frz. Shift vector is added before rotation and subtracted after it. |
1670 */ | 1670 */ |
1671 static void transform_3d(FT_Vector shift, FT_Glyph* glyph, FT_Glyph* glyph2, double frx, double fry, double frz) | 1671 static void transform_3d(FT_Vector shift, FT_Glyph* glyph, FT_Glyph* glyph2, double frx, double fry, double frz) |
1672 { | 1672 { |
1673 fry = - fry; // FreeType's y axis goes in the opposite direction | |
1673 if (frx != 0. || fry != 0. || frz != 0.) { | 1674 if (frx != 0. || fry != 0. || frz != 0.) { |
1674 double m[16]; | 1675 double m[16]; |
1675 double sx = sin(frx); | 1676 double sx = sin(frx); |
1676 double sy = sin(fry); | 1677 double sy = sin(fry); |
1677 double sz = sin(frz); | 1678 double sz = sin(frz); |
1678 double cx = cos(frx); | 1679 double cx = cos(frx); |
1679 double cy = cos(fry); | 1680 double cy = cos(fry); |
1680 double cz = cos(frz); | 1681 double cz = cos(frz); |
1681 m[0] = cy * cz; m[1] = cz*sx*sy + sz*cx; m[2] = sz*sx - cz*cx*sy; m[3] = 0.0; | 1682 m[0] = cy * cz; m[1] = cy*sz; m[2] = -sy; m[3] = 0.0; |
1682 m[4] = -sz*cy; m[5] = cz*cx - sz*sy*sx; m[6] = sz*sy*cx + cz*sx; m[7] = 0.0; | 1683 m[4] = -cx*sz + sx*sy*cz; m[5] = cx*cz + sx*sy*sz; m[6] = sx*cy; m[7] = 0.0; |
1683 m[8] = sy; m[9] = -sx*cy; m[10] = cx*cy; m[11] = 0.0; | 1684 m[8] = sx*sz + cx*sy*cz; m[9] = -sx*cz + cx*sy*sz; m[10] = cx*cy; m[11] = 0.0; |
1684 m[12] = 0.0; m[13] = 0.0; m[14] = 0.0; m[15] = 1.0; | 1685 m[12] = 0.0; m[13] = 0.0; m[14] = 0.0; m[15] = 1.0; |
1685 | 1686 |
1686 if (glyph && *glyph) | 1687 if (glyph && *glyph) |
1687 transform_glyph_3d(*glyph, m, shift); | 1688 transform_glyph_3d(*glyph, m, shift); |
1688 | 1689 |
1689 if (glyph2 && *glyph2) | 1690 if (glyph2 && *glyph2) |