如何在three.js中使用不同的相机渲染相同的场景? [英] How to render the same scene with different cameras in three.js?
本文介绍了如何在three.js中使用不同的相机渲染相同的场景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我设置了一个场景,我希望两台摄像机以不同的角度、正面和视角观看同一场景.背部.我试过这样的事情:
I had a scene set up and I want two cameras watch the same scene at a different angle, front & back. I tried something like this:
renderer.setViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT/2);
renderer.render(scene, camera);
renderer.setViewport(0, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT/2);
renderer.render(scene, testcamera);
但是返回的第二个视图从未出现过.知道为什么吗?
But the 2nd view which is back never showed up. Any idea why?
推荐答案
我收藏了几个例子,有一个使用渲染管理器的有趣帖子:
A couple of examples I have bookmarked, there is an interesting post using a render manager:
http://bkcore.com/blog/3d/webgl-three-js-extension-rendermanager.html
也在 three.js
示例中:
http://mrdoob.github.com/three.js/examples/webgl_multiple_views.html
这篇关于如何在three.js中使用不同的相机渲染相同的场景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文