Skip to content

Commit

Permalink
Poi3D models: correct flip axis on loading (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustl22 authored and devemux86 committed Mar 5, 2019
1 parent 4d35b72 commit bda4885
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion vtm-gdx-poi3d/src/org/oscim/gdx/poi3d/GdxModelLayer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2018 Gustl22
* Copyright 2018-2019 Gustl22
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -106,8 +106,10 @@ private void doneLoading() {
model.nodes.removeIndex(0);
model.nodes.add(node);
}
node.scale.set(1, 1, -1);
node.rotation.setFromAxis(1, 0, 0, 90);
}
model.calculateTransforms();
poiModel.setModel(model);
}

Expand Down
6 changes: 4 additions & 2 deletions vtm-gdx-poi3d/src/org/oscim/gdx/poi3d/GdxRenderer3D2.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ public void render(GLViewport v) {
GLState.test(false, false);
GLState.blend(false);

// GL.cullFace(GL20.BACK);
// GL.frontFace(GL20.CW);
//gl.cullFace(GL.BACK);
/* flip front face cause of mirror inverted y-axis */
gl.frontFace(GL.CCW);

cam.update(v);
long time = System.currentTimeMillis();
Expand Down Expand Up @@ -160,6 +161,7 @@ public void render(GLViewport v) {

// GLUtils.checkGlError("<" + TAG);

gl.frontFace(GL.CW);
gl.depthMask(false);
GLState.bindElementBuffer(GLState.UNBIND);
GLState.bindBuffer(GL.ARRAY_BUFFER, GLState.UNBIND);
Expand Down
4 changes: 3 additions & 1 deletion vtm-gdx-poi3d/src/org/oscim/gdx/poi3d/Poi3DLayer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2018 Gustl22
* Copyright 2018-2019 Gustl22
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -307,8 +307,10 @@ private void doneLoading() {
model.nodes.removeIndex(0);
model.nodes.add(node);
}
node.scale.set(1, 1, -1);
node.rotation.setFromAxis(1, 0, 0, 90);
}
model.calculateTransforms();
holder.setModel(model);
}
}
Expand Down

0 comments on commit bda4885

Please sign in to comment.