Poi3D models: correct flip axis on loading (#687)

This commit is contained in:
Gustl22 2019-03-03 21:54:41 +01:00 committed by Emux
parent 4d35b72b25
commit bda48858ba
No known key found for this signature in database
GPG Key ID: 64ED9980896038C3
3 changed files with 10 additions and 4 deletions

View File

@ -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
@ -106,8 +106,10 @@ public class GdxModelLayer extends Layer implements Map.UpdateListener {
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);
}

View File

@ -116,8 +116,9 @@ public class GdxRenderer3D2 extends LayerRenderer {
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();
@ -160,6 +161,7 @@ public class GdxRenderer3D2 extends LayerRenderer {
// GLUtils.checkGlError("<" + TAG);
gl.frontFace(GL.CW);
gl.depthMask(false);
GLState.bindElementBuffer(GLState.UNBIND);
GLState.bindBuffer(GL.ARRAY_BUFFER, GLState.UNBIND);

View File

@ -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
@ -307,8 +307,10 @@ public class Poi3DLayer extends Layer implements Map.UpdateListener, ZoomLimiter
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);
}
}