简体   繁体   中英

3d object depth parameter affects perceived width

I have created one RectangularPrism with default camera in Rajawali 1.1.777:

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

Depending on x (depth) the perceived width on the Android screen varies.

  • If the depth is 2f the width of the prism fills the screen.
  • If the depth is 0.5f & 1f the width of the prism does not fill the screen.

So from a Rajawali/OpenGL perspective how and why does the depth parameter affect the perceived width of the object on the screen? Since the width (2f) is kept static shouldn't the prism always fill the screen in the same way?

0.1f:

0.1F

1f:

1F

2f:

2F

Answer from 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. 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. 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.

If perspective is not desired, one may instantiate an Orthographic Camera and getCurrentScene().addAndSwitchCamera(orthographicCamera).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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