最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to controll perspective distortion of THREE.PerspectiveCamera - Stack Overflow

programmeradmin0浏览0评论

My goal is to render collada object and place it perfectly over image with this object.

Lets say that I have image that was rendered by v-ray renderer in 3ds max (green one) and collada object that I render by three js using perpective camera (red one).
The problem is I have bigger perspective distortion on rendered object than on image.
I saw that THREE.PerspectiveCamera has focus property that seems like what I'm looking for. But when I change it nothing happens.
THREEJS documentation says:

.focus

Object distance used for stereoscopy and depth-of-field effects. This parameter does not influence the projection matrix unless a StereoCamera is being used.

But I didn't found anything about StereoCamera in three js documentation.

Does anyone can help me cope with this?

My goal is to render collada object and place it perfectly over image with this object.

Lets say that I have image that was rendered by v-ray renderer in 3ds max (green one) and collada object that I render by three js using perpective camera (red one).
The problem is I have bigger perspective distortion on rendered object than on image.
I saw that THREE.PerspectiveCamera has focus property that seems like what I'm looking for. But when I change it nothing happens.
THREEJS documentation says:

.focus

Object distance used for stereoscopy and depth-of-field effects. This parameter does not influence the projection matrix unless a StereoCamera is being used.

But I didn't found anything about StereoCamera in three js documentation.

Does anyone can help me cope with this?

Share Improve this question edited Nov 30, 2016 at 14:21 WestLangley 105k11 gold badges287 silver badges283 bronze badges asked Nov 30, 2016 at 12:27 Andrii TsarenkoAndrii Tsarenko 7057 silver badges22 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12

It's better to change FOV of your PerspectiveCamera.

camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 1, 3000);

So, the first parameter 60 is Field of view (FOV). The less value of this parameter, the less distortion you'll get, but the more you have to move your camera backwards to keep appropriate view of your scene or the more you have to scale your object down. Depends on what you want to get, play around with FOV of you camera and scaling of your object.

发布评论

评论列表(0)

  1. 暂无评论