我正在使用LibGdx創建具有等角度透視的遊戲。我的代碼是基於這個例子:Isometric Tile Picking如何在等距場景中使用Libgdx移動攝像機
我需要在屏幕中心瓷磚。我試圖用camera.lookAt(),但它不起作用。
public boolean tap(float screenX, float screenY, int count, int button) {
touch.set(screenX, screenY, 0);
cam.unproject(touch);
touch.mul(invIsotransform);
pickedTileX = (int) touch.x;
pickedTileY = (int) touch.y;
cam.lookAt(pickedTileX, pickedTileY, 0);
任何想法? 謝謝!
我不認爲你想從位置減去一半的屏幕尺寸。 – Tenfour04
好, 使用你的提示它看起來更好,但它不準確。 爲什麼我們不需要涉及等距變換矩陣?我有點失落了 – Alejandro