admin管理员组文章数量:1356784
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 badges1 Answer
Reset to default 12It'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.
本文标签: javascriptHow to controll perspective distortion of THREEPerspectiveCameraStack Overflow
版权声明:本文标题:javascript - How to controll perspective distortion of THREE.PerspectiveCamera - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744042876a2580986.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论