Orthographic and Perspective Camera issue

穿精又带淫゛_ 提交于 2019-12-13 02:57:05

问题


This image is using perspective camera but sphere shape is distorted when it is moving away from the center.

this image is using Orthographic camera but spheres and cuboid are not in 3D...

can any one suggest possible solution for this to get 3D effect without sphere distorting its shape...


回答1:


This is exactly correct. Spheres distortion and cuboid perspective effect are both caused by the same perspective projection properties.

One possible solution would be to split your scene in two parts:

  • render background (cuboid) with perspective projection
  • render spheres using orthographic projection

Another solution would be to draw everything with orthographic and modify your cuboid to be a trapezoid, so that it only looks like to be in perspective.

Having perspective and no distortions sounds mutually exclusive if you think about it. Imagine a sphere consists of 2 parts - front and rear. Now you say you need objects farther from camera to be smaller, but at the same time you say you want front and rear of sphere to be the same size - not possible. You can achieve desired effect with orthographic projection if you manually specify spheres size to be smaller when they are farther. Or alternatively you can use perspective projection and scale your spheres to be flat by depth axis (but keep the normals to preserve proper lighting)



来源:https://stackoverflow.com/questions/22091248/orthographic-and-perspective-camera-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!