three.js: how to control rendering order

前端 未结 4 592
不知归路
不知归路 2020-12-06 05:13

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 sp

4条回答
  •  时光取名叫无心
    2020-12-06 05:42

    You can set

    renderer.sortObjects = false;
    

    and the objects will be rendered in the order they were added to the scene.

    Alternatively, you can leave sortObjects as true, the default, and specify for each object a value for object.renderOrder.

    For more detail, see Transparent objects in Threejs

    Another thing you can do is use the approach described here: How to change the zOrder of object with Threejs?

    three.js r.71

提交回复
热议问题