From d53497d92f2b867f8df6705628bf91880a810c7e Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Fri, 1 Jun 2007 11:43:53 +0000 Subject: [PATCH] when calculating vertices, apply perspective before all other tranforms --- ChangeLog | 6 ++++++ clutter/clutter-actor.c | 31 +++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3df2a681..c598798a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,12 @@ of entry-related keyboard keys. However modifiers still need to be implemented. +2007-06-01 Tomas Frydrych + + * clutter/clutter-actor.c: + (mtx_create): + Apply perspective transform before all other transforms. + 2007-06-01 Tomas Frydrych * clutter/clutter-stage.c: diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 0f22d0c3e..02e69b8d9 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -586,6 +586,35 @@ mtx_create (ClutterActorPrivate *priv, /* FIXME: need to apply perspective / viewport transforms */ mtx_identity (mtx); + mtx_mul (mtx, mtx_p); + +#if 0 + g_debug ("Perspective Matrix\n" + " %f, %f, %f, %f\n" + " %f, %f, %f, %f\n" + " %f, %f, %f, %f\n" + " %f, %f, %f, %f", + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,0,0)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,0,1)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,0,2)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,0,3)), + + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,1,0)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,1,1)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,1,2)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,1,3)), + + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,2,0)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,2,1)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,2,2)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,2,3)), + + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,3,0)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,3,1)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,3,2)), + CLUTTER_FIXED_TO_FLOAT (M(mtx_p,3,3))); +#endif + /* * All the rotation ops are relative to the actor, not the overall * coordiante system; so first of all, we carry out a translation from @@ -648,8 +677,6 @@ mtx_create (ClutterActorPrivate *priv, { mtx_scale (mtx, priv->scale_x, priv->scale_y); } - - mtx_mul (mtx, mtx_p); } /**