简体   繁体   English

3D物体深度参数会影响感知宽度

[英]3d object depth parameter affects perceived width

I have created one RectangularPrism with default camera in Rajawali 1.1.777: 我在Rajawali 1.1.777中使用默认相机创建了一个RectangularPrism

RectangularPrism p = new RectangularPrism(2f, 2f, xf);

Depending on x (depth) the perceived width on the Android screen varies. 根据x(深度),Android屏幕上的感知宽度会有所不同。

  • If the depth is 2f the width of the prism fills the screen. 如果深度为2f,则棱镜的宽度将填满屏幕。
  • If the depth is 0.5f & 1f the width of the prism does not fill the screen. 如果深度为0.5f和1f,则棱镜的宽度不会填满屏幕。

So from a Rajawali/OpenGL perspective how and why does the depth parameter affect the perceived width of the object on the screen? 那么从Rajawali / OpenGL的角度来看,深度参数如何以及为什么会影响屏幕上对象的感知宽度? Since the width (2f) is kept static shouldn't the prism always fill the screen in the same way? 由于宽度(2f)保持不变,棱镜不应该总是以相同的方式填充屏幕吗?

0.1f: 0.1F:

0.1F

1f: 1F:

1F

2f: 2F:

2F

Answer from https://github.com/Rajawali/Rajawali/issues/1883 来自https://github.com/Rajawali/Rajawali/issues/1883的答复

The default camera is a Perspective Camera, faces in the distance appear smaller than faces close by. 默认相机是“透视相机”,远处的面孔看起来小于附近的面孔。 The default camera is located at 0,0,4 and looks at 0,0,0. 默认摄像头位于0,0,4,外观为0,0,0。 If one places a RectangularPrism of size 2,2,0.5 at 0,0,0, the distance between the camera and the closest face is 3.75. 如果将一个大小为2,2,0.5的RectangularPrism放置在0,0,0,则相机和最近的脸部之间的距离为3.75。 If one places a RectangularPrism of size 2,2,2 at 0,0,0, the distance between the camera and the closest face is only 3, and so the closest face appears bigger. 如果将一个大小为2,2,2的RectangularPrism放置在0,0,0,则相机和最近的脸部之间的距离仅为3,因此最近的脸部显得更大。

If perspective is not desired, one may instantiate an Orthographic Camera and getCurrentScene().addAndSwitchCamera(orthographicCamera). 如果不需要透视,则可以实例化一个Orthographic Camera并获取getCurrentScene()。addAndSwitchCamera(orthographicCamera)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM