~ubuntu-branches/ubuntu/precise/s3d/precise

« back to all changes in this revision

Viewing changes to debian/patches/106-g3dorientation.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sven Eckelmann
  • Date: 2009-03-18 14:14:38 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090318141438-z5lryfho0jymasbd
Tags: 0.2.1-11
debian/rules: Don't install TODO file with every package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From ed9ca2736bf3d18a709a7ab2a477d098b13174b2 Mon Sep 17 00:00:00 2001
 
2
From: Sven Eckelmann <sven.eckelmann@gmx.de>
 
3
Date: Sun, 15 Feb 2009 11:08:16 +0000
 
4
Subject: [PATCH] Transform g3d model orientation to s3d orientation
 
5
 
 
6
libg3d changed the model orientation in rev378 (precedes libg3d 0.0.7).
 
7
All s3d programs expect a different rotation around the x axis and we
 
8
should give them their data as before.
 
9
g3d_model_transform is a new function in libg3d 0.0.7 so we need to
 
10
depend at least on that version.
 
11
---
 
12
 cmake/modules/FindG3D.cmake |    2 +-
 
13
 libs3d/modelread.c          |    5 +++++
 
14
 2 files changed, 6 insertions(+), 1 deletions(-)
 
15
 
 
16
diff --git a/cmake/modules/FindG3D.cmake b/cmake/modules/FindG3D.cmake
 
17
index 2242c1f..4e9356f 100644
 
18
--- a/cmake/modules/FindG3D.cmake
 
19
+++ b/cmake/modules/FindG3D.cmake
 
20
@@ -11,5 +11,5 @@ if (G3D_LIBRARIES AND G3D_INCLUDE_DIRS)
 
21
 else (G3D_LIBRARIES AND G3D_INCLUDE_DIRS)
 
22
        find_package(PkgConfig)
 
23
 
 
24
-       pkg_search_module(G3D libg3d>=0.0.6)
 
25
+       pkg_search_module(G3D libg3d>=0.0.7)
 
26
 endif (G3D_LIBRARIES AND G3D_INCLUDE_DIRS)
 
27
diff --git a/libs3d/modelread.c b/libs3d/modelread.c
 
28
index 8d03198..2f82253 100644
 
29
--- a/libs3d/modelread.c
 
30
+++ b/libs3d/modelread.c
 
31
@@ -25,6 +25,7 @@
 
32
 #include "s3d.h"
 
33
 #include "s3dlib.h"
 
34
 #include <g3d/g3d.h>
 
35
+#include <g3d/matrix.h>
 
36
 #include <stdlib.h>   /*  exit(), malloc() */
 
37
 #include <math.h>   /*  sqrt() */
 
38
 #include <string.h>   /*  strncpy() */
 
39
@@ -122,6 +123,7 @@ static int model_load(char *file)
 
40
        G3DObject     *object;
 
41
        G3DFace     *face;
 
42
        GSList      *oitem, *oface;
 
43
+       G3DMatrix rmatrix[16];
 
44
        struct material2texture *mat2tex;
 
45
        unsigned int i, k;
 
46
        int       j, material_count, texture_count, voff, obj_id;
 
47
@@ -136,6 +138,9 @@ static int model_load(char *file)
 
48
        model = g3d_model_load_full(context, file, 0);
 
49
 
 
50
        if (model) {
 
51
+               g3d_matrix_identity(rmatrix);
 
52
+               g3d_matrix_rotate_xyz(G_PI * 90.0 / 180, 0.0, 0.0, rmatrix);
 
53
+               g3d_model_transform(model, rmatrix);
 
54
 
 
55
                oitem = model->objects;
 
56
                obj_id = s3d_new_object();
 
57
-- 
 
58
1.6.1.3
 
59