如何获得对正交图的透视图 [英] how to get a perspecitve look to an orthogonal tilemap
问题描述
我目前正在使用正交贴图,而不是等轴测图.但我想透视一下.第一个画面显示了我目前拥有的东西,第二个画面显示了我的目标.
I am currentliy using an orthogonal map, not an isometric. But I would like to get an perspective look. the first picuture shows, what I currently have, the second shows my goal.
以某种方式使用变换矩阵是否可行?我只是设法缩放整个图像.
Isn't it possible to do it with a transform matrix somehow? I did only manage to scale the whole image..
推荐答案
You can use MapRenderer.setView(...)
to achieve that.
创建一个PerspectiveCamera
并将其设置为具有第二张图片中显示的透视图.请注意,平铺的地图将被渲染到X/Y平面,您需要相应地设置相机的位置和视点矢量.
Create a PerspectiveCamera
and set it up to have the perspective that you've shown in your second picture. Note that the tiled map will be rendered to the X/Y-plane and you need to set your camera's position and look-at vectors accordingly.
完成此操作后,将MapRenderer.setView(...)
与camera.combined
矩阵一起使用.
When you are done with that, use MapRenderer.setView(...)
with the camera.combined
matrix.
这篇关于如何获得对正交图的透视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!