three.js:如何控制渲染顺序 [英] three.js: how to control rendering order
问题描述
现在用three.js
Am using three.js
如何控制渲染顺序?比方说,我有三个平面的几何形状,并希望使它们按照特定的顺序,无论其空间位置。
How can I control the rendering order? Let's say I have three plane geometries, and want to render them in a specific order regardless of their spatial position.
感谢
推荐答案
您可以设置
renderer.sortObjects = false;
和的目的将在它们被添加到场景的顺序来呈现。
and the objects will be rendered in the order they were added to the scene.
另外,你可以离开 sortObjects
为真
,默认值,并指定每个对象的值 object.renderOrder
。
Alternatively, you can leave sortObjects
as true
, the default, and specify for each object a value for object.renderOrder
.
有关详细信息,请参阅<一href="http://stackoverflow.com/questions/15994944/transparent-objects-in-threejs/15995475#15995475">Transparent在Threejs 对象
For more detail, see Transparent objects in Threejs
您可以做的另一件事是使用下面介绍的方法:<一href="http://stackoverflow.com/questions/12666570/how-to-change-the-zorder-of-object-with-threejs">How与Threejs改变对象的ZORDER?
Another thing you can do is use the approach described here: How to change the zOrder of object with Threejs?
three.js r.71
three.js r.71
这篇关于three.js:如何控制渲染顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!