~ubuntu-branches/ubuntu/trusty/s3d/trusty-proposed

« 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-07-11 17:00:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090711170052-2lltwp4rr01e6oly
* New upstream release
* debian/control:
  - Reduce debhelper dependency to 5
  - Only depend on xmlto and docbook-xml in Build-Depends-Indep for
    arch all package s3d-doc
* debian/patches:
  - Add 100-installable-examples.patch, make example usable without
    extra headers
  - Remove upstream merged patches 100-hyphen-used-as-minus-sign.patch,
    101-fix-sigbus-on-mips.patch, 102-send-correct-load-over-net.patch,
    103-endian-safe-float.patch, 104-reduce-depends.patch,
    105-s3dfm-pathnames.patch, 106-g3dorientation.patch,
    107-fix-cmake-ftbfs.patch, 108-fix-gpsd-ftbfs.patch,
    109-strip-libs3d-parameters.patch, 110-s3dosm-api06.patch,
    111-xmlto-documentation.patch
* Install examples with libs3d-dev and libs3dw-dev
* Convert debian/copyright to new dep5 version
* Upgraded to policy 3.8.2, no changes required
* Install upstream changelogs

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
 
1.6.1.3
58