From 2c5fd391762044979a250e1171d8f9917db0cb6b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 22 Mar 2021 08:55:21 +0100 Subject: [PATCH 1/2] Provide a dockerfile closes https://github.com/assimp/assimp/issues/1063: --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..b65d131a4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:14.04 + +RUN apt-get update && apt-get install -y \ + git cmake build-essential software-properties-common + +RUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update && apt-get install -y gcc-4.9 g++-4.9 && \ + cd /usr/bin && \ + rm gcc g++ cpp && \ + ln -s gcc-4.9 gcc && \ + ln -s g++-4.9 g++ && \ + ln -s cpp-4.9 cpp + +WORKDIR /opt + +# Build Assimp +RUN git clone https://github.com/assimp/assimp.git /opt/assimp + +WORKDIR /opt/assimp + +RUN git checkout master \ + && mkdir build && cd build && \ + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + .. && \ + make && make install From 348c34811f5895b3ab086baabbdf6d43443d623a Mon Sep 17 00:00:00 2001 From: Bernold Kraft Date: Fri, 26 Mar 2021 22:21:45 +0100 Subject: [PATCH 2/2] Fixing CHUNK_TRMATRIX translation sub chunk and therefore omitting the transform aggregation in the CHUNK_VERTLIST. --- code/AssetLib/3DS/3DSExporter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/3DS/3DSExporter.cpp b/code/AssetLib/3DS/3DSExporter.cpp index 32d45c039..108d917d1 100644 --- a/code/AssetLib/3DS/3DSExporter.cpp +++ b/code/AssetLib/3DS/3DSExporter.cpp @@ -444,7 +444,7 @@ void Discreet3DSExporter::WriteMeshes() { const uint16_t count = static_cast(mesh.mNumVertices); writer.PutU2(count); for (unsigned int i = 0; i < mesh.mNumVertices; ++i) { - const aiVector3D &v = trafo * mesh.mVertices[i]; + const aiVector3D &v = mesh.mVertices[i]; writer.PutF4(v.x); writer.PutF4(v.y); writer.PutF4(v.z); @@ -506,11 +506,16 @@ void Discreet3DSExporter::WriteMeshes() { // Transformation matrix by which the mesh vertices have been pre-transformed with. { ChunkWriter curChunk(writer, Discreet3DS::CHUNK_TRMATRIX); - for (unsigned int r = 0; r < 4; ++r) { + // Store rotation 3x3 matrix row wise + for (unsigned int r = 0; r < 3; ++r) { for (unsigned int c = 0; c < 3; ++c) { writer.PutF4(trafo[r][c]); } } + // Store translation sub vector column wise + for (unsigned int r = 0; r < 3; ++r) { + writer.PutF4(trafo[r][3]); + } } } }