On Fri, May 15, 2009 at 09:12:38AM +0800, Jake Knickerbocker wrote: > Hi there, > > I've been playing with Clutter for about a month now and > am completely impressed. I've been using version 0.8 and > find it very stable (at least for the relatively simple things I've > been doing) and am very much looking forward to the 1.0 > release. Thank you for such a great library. > > I do have a question. What would it take to get 3D models into Clutter? > I know there is an extension library written by someone out there > who did some kind of car racing game in Clutter, but I am wracking > my brain lately trying to remember the name of that. It's clutter-md2 by Neil Roberts:
http://github.com/bpeel/clutter-md2/tree/master I sent him a patch for clutter-0.9, you may need it. - Roger > > Maybe this is beyond the scope of the current incarnation and goals > of Clutter, but would it be possible to create a custom 3D actor? > > Thanks, > Jake
>From dfca290f42ab1497040f073ea02eb57184fb31b0 Mon Sep 17 00:00:00 2001 From: Wang, Roger <[email protected]> Date: Wed, 6 May 2009 22:07:41 +0800 Subject: [PATCH] build against clutter-0.9/1.0 --- clutter-md2/clutter-behaviour-md2-animate.c | 12 +++++------- clutter-md2/clutter-behaviour-md2-animate.h | 3 +-- clutter-md2/clutter-md2-data.c | 2 +- clutter-md2/clutter-md2.c | 2 +- clutter-md2/clutter-md2.h | 2 +- configure.ac | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/clutter-md2/clutter-behaviour-md2-animate.c b/clutter-md2/clutter-behaviour-md2-animate.c index 18391e9..ac568b9 100644 --- a/clutter-md2/clutter-behaviour-md2-animate.c +++ b/clutter-md2/clutter-behaviour-md2-animate.c @@ -27,7 +27,7 @@ #include "config.h" #endif -#include <clutter/clutter-behaviour.h> +#include <clutter/clutter.h> #include "clutter-md2.h" #include "clutter-behaviour-md2-animate.h" @@ -76,7 +76,7 @@ alpha_notify_foreach (ClutterBehaviour *behaviour, static void clutter_behaviour_md2_animate_alpha_notify (ClutterBehaviour *behaviour, - guint32 alpha_value) + gdouble alpha_value) { ClutterBehaviourMD2Animate *animate_behaviour; ClutterBehaviourMD2AnimatePrivate *priv; @@ -103,21 +103,19 @@ clutter_behaviour_md2_animate_alpha_notify (ClutterBehaviour *behaviour, gint temp = frame_start; frame_start = frame_end; frame_end = temp; - alpha_value = CLUTTER_ALPHA_MAX_ALPHA - alpha_value; + alpha_value = 1 - alpha_value; } alpha_multiple = alpha_value * (frame_end - frame_start); - data.frame_a = alpha_multiple / CLUTTER_ALPHA_MAX_ALPHA - + frame_start; + data.frame_a = alpha_multiple + frame_start; if (data.frame_a == priv->frame_end) data.frame_b = data.frame_a; else data.frame_b = data.frame_a + 1; - data.interval = alpha_multiple % CLUTTER_ALPHA_MAX_ALPHA - / (float) CLUTTER_ALPHA_MAX_ALPHA; + data.interval = alpha_multiple; } clutter_behaviour_actors_foreach (behaviour, diff --git a/clutter-md2/clutter-behaviour-md2-animate.h b/clutter-md2/clutter-behaviour-md2-animate.h index 7a29380..02862fd 100644 --- a/clutter-md2/clutter-behaviour-md2-animate.h +++ b/clutter-md2/clutter-behaviour-md2-animate.h @@ -26,8 +26,7 @@ #ifndef __CLUTTER_BEHAVIOUR_MD2_ANIMATE_H__ #define __CLUTTER_BEHAVIOUR_MD2_ANIMATE_H__ -#include <clutter/clutter-alpha.h> -#include <clutter/clutter-behaviour.h> +#include <clutter/clutter.h> G_BEGIN_DECLS diff --git a/clutter-md2/clutter-md2-data.c b/clutter-md2/clutter-md2-data.c index 85bd5bf..6588e2d 100644 --- a/clutter-md2/clutter-md2-data.c +++ b/clutter-md2/clutter-md2-data.c @@ -30,7 +30,7 @@ #include <glib-object.h> #include <glib/gstdio.h> #include <gdk-pixbuf/gdk-pixbuf.h> -#include <clutter/clutter-util.h> +#include <clutter/clutter.h> #include <errno.h> #include <string.h> /* Include cogl to get the right GL header for this platform */ diff --git a/clutter-md2/clutter-md2.c b/clutter-md2/clutter-md2.c index 1acee89..f9d97fd 100644 --- a/clutter-md2/clutter-md2.c +++ b/clutter-md2/clutter-md2.c @@ -28,7 +28,7 @@ #endif #include <glib-object.h> -#include <clutter/clutter-actor.h> +#include <clutter/clutter.h> #include <string.h> #include "clutter-md2.h" diff --git a/clutter-md2/clutter-md2.h b/clutter-md2/clutter-md2.h index 51f966a..6bef968 100644 --- a/clutter-md2/clutter-md2.h +++ b/clutter-md2/clutter-md2.h @@ -27,7 +27,7 @@ #define __CLUTTER_MD2_H__ #include <glib-object.h> -#include <clutter/clutter-actor.h> +#include <clutter/clutter.h> #include <clutter-md2/clutter-md2-data.h> G_BEGIN_DECLS diff --git a/configure.ac b/configure.ac index a872dcc..3ff0544 100644 --- a/configure.ac +++ b/configure.ac @@ -76,7 +76,7 @@ AC_C_CONST dnl ======================================================================== -CLUTTER_MD2_REQUIRES="clutter-0.8 glib-2.0 >= 2.14 gobject-2.0 gdk-pixbuf-2.0" +CLUTTER_MD2_REQUIRES="clutter-0.9 glib-2.0 >= 2.14 gobject-2.0 gdk-pixbuf-2.0" PKG_CHECK_MODULES(CLUTTER_MD2_DEPS, [$CLUTTER_MD2_REQUIRES]) -- 1.6.2.4
