From 9924eebe3f36ff144a4895880f9b732f1642d8ed Mon Sep 17 00:00:00 2001 From: Roi Cohen Date: Fri, 20 Apr 2007 16:07:44 +0300 Subject: [PATCH] correct-vertical-rotation --- src/paint.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/paint.c b/src/paint.c index c2609bd..39fdd9e 100644 --- a/src/paint.c +++ b/src/paint.c @@ -44,6 +44,8 @@ preparePaintScreen (CompScreen *screen, void donePaintScreen (CompScreen *screen) {} +#define DEG2RAD (M_PI / 180.0f) + void applyScreenTransform (CompScreen *screen, const ScreenPaintAttrib *sAttrib, @@ -58,9 +60,9 @@ applyScreenTransform (CompScreen *screen, sAttrib->xRotate, 0.0f, 1.0f, 0.0f); matrixRotate (transform, sAttrib->vRotate, - 1.0f - sAttrib->xRotate / 90.0f, + cos(sAttrib->xRotate * DEG2RAD), 0.0f, - sAttrib->xRotate / 90.0f); + sin(sAttrib->xRotate * DEG2RAD)); matrixRotate (transform, sAttrib->yRotate, 0.0f, 1.0f, 0.0f); } -- 1.4.4.2