【问题标题】:How can I set the Perspective Camera in game like the picture? (Engine libgdx)如何像图片一样在游戏中设置透视相机? (引擎 libgdx)
【发布时间】:2013-08-29 14:25:30
【问题描述】:

我是 3D 游戏的新手?我正在使用 Libgdx。如何计算像 Tetromino Revolution 游戏这样的透视相机的参数?请给我任何想法。

查看图片:http://www.terminalstudio.com/screens/tetrisrev/big1.jpg

【问题讨论】:

    标签: libgdx perspectivecamera


    【解决方案1】:

    这是一个很好的教程,可以满足您的需要。

    http://blog.xoppa.com/basic-3d-using-libgdx-2/

    【讨论】:

      【解决方案2】:

      你可以这样设置摄像头:

      float fieldOfView = 45;
      float w = Gdx.graphics.getWidth();
      float h = Gdx.graphics.getHeight();
      PerspectiveCamera camera = new PerspectiveCamera(fieldOfView, 1, h/w);
      camera.position.z = -2f; //just an example of camera displacement
      camera.update();
      

      fieldOfView 越大,您的风景中的视角就越多。 您现在可以将积木或其他东西放在 x-y 平面上,它可能看起来很相似。

      我建议您先阅读一些教程,以了解 3D 编程的感觉。看来你很快就会有一些其他的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-05-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-05-27
        • 2011-08-21
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多