我有一个libgdx乘法,在这里我创建了一个由立方体组成的迷宫。当我呈现底部的蓝色的和顶部的红色的脸时,下面的一个在顶部的前面呈现。两面都有相同的法向量。
我能换一架很远很近的剪贴机吗?
以下是我如何设置摄像机:
public PerspectiveCamera updateCamera() {
if (camera == null) {
float aspectRatio = Gdx.graphics.getWidth() / Gdx.graphics.getHeight();
camera = new PerspectiveCamera(67f, aspectRatio, 1);
this.setActive(true);
}
return camera;
}
发布于 2012-12-21 08:08:36
我只是忘了增加深度测试。
添加到create()方法:
Gdx.gl.glEnable(GL10.GL_DEPTH_TEST);
Gdx.gl.glDepthFunc(GL10.GL_LESS);
添加到render()方法中:
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
https://stackoverflow.com/questions/13985425
复制相似问题