[vlc-commits] opengl: fix orientation matrices
Romain Vimont
git at videolan.org
Wed Jun 17 18:39:14 CEST 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Mon Jun 15 19:24:24 2020 +0200| [ed1f5dd55a325562532c16ad898aa78ae6bd6e63] | committer: Alexandre Janniaux
opengl: fix orientation matrices
The orientation matrices were incorrect.
This commit is just here to show the differences, but the next commit
will rewrite their initialization to make them more readable.
Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ed1f5dd55a325562532c16ad898aa78ae6bd6e63
---
modules/video_output/opengl/sampler.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/modules/video_output/opengl/sampler.c b/modules/video_output/opengl/sampler.c
index fade9fd48a..c4482d88d0 100644
--- a/modules/video_output/opengl/sampler.c
+++ b/modules/video_output/opengl/sampler.c
@@ -559,25 +559,25 @@ InitOrientationMatrix(GLfloat matrix[static 4*4],
case ORIENT_ROTATED_90:
matrix[0 * 4 + 0] = k_cos_pi_2;
- matrix[0 * 4 + 1] = -k_sin_pi_2;
- matrix[1 * 4 + 0] = k_sin_pi_2;
+ matrix[0 * 4 + 1] = k_sin_pi_2;
+ matrix[1 * 4 + 0] = -k_sin_pi_2;
matrix[1 * 4 + 1] = k_cos_pi_2;
- matrix[3 * 4 + 1] = 1;
+ matrix[3 * 4 + 0] = 1;
break;
case ORIENT_ROTATED_180:
matrix[0 * 4 + 0] = k_cos_pi;
- matrix[0 * 4 + 1] = -k_sin_pi;
- matrix[1 * 4 + 0] = k_sin_pi;
+ matrix[0 * 4 + 1] = k_sin_pi;
+ matrix[1 * 4 + 0] = -k_sin_pi;
matrix[1 * 4 + 1] = k_cos_pi;
matrix[3 * 4 + 0] = 1;
matrix[3 * 4 + 1] = 1;
break;
case ORIENT_ROTATED_270:
matrix[0 * 4 + 0] = k_cos_n_pi_2;
- matrix[0 * 4 + 1] = -k_sin_n_pi_2;
- matrix[1 * 4 + 0] = k_sin_n_pi_2;
+ matrix[0 * 4 + 1] = k_sin_n_pi_2;
+ matrix[1 * 4 + 0] = -k_sin_n_pi_2;
matrix[1 * 4 + 1] = k_cos_n_pi_2;
- matrix[3 * 4 + 0] = 1;
+ matrix[3 * 4 + 1] = 1;
break;
case ORIENT_HFLIPPED:
matrix[0 * 4 + 0] = -1;
@@ -590,18 +590,16 @@ InitOrientationMatrix(GLfloat matrix[static 4*4],
case ORIENT_TRANSPOSED:
matrix[0 * 4 + 0] = 0;
matrix[1 * 4 + 1] = 0;
- matrix[2 * 4 + 2] = -1;
- matrix[0 * 4 + 1] = 1;
- matrix[1 * 4 + 0] = 1;
+ matrix[0 * 4 + 1] = -1;
+ matrix[1 * 4 + 0] = -1;
+ matrix[3 * 4 + 0] = 1;
+ matrix[3 * 4 + 1] = 1;
break;
case ORIENT_ANTI_TRANSPOSED:
matrix[0 * 4 + 0] = 0;
matrix[1 * 4 + 1] = 0;
- matrix[2 * 4 + 2] = -1;
matrix[0 * 4 + 1] = -1;
matrix[1 * 4 + 0] = -1;
- matrix[3 * 4 + 0] = 1;
- matrix[3 * 4 + 1] = 1;
break;
default:
break;
More information about the vlc-commits
mailing list