Three.js line disappears if one point is outside of the camera's view

爷,独闯天下 提交于 2019-12-13 13:11:50

问题


I created a line as explained in the docs: http://threejs.org/docs/#Reference/Objects/Line.

But when one of the line points is outside of the camera's view, the line disappears.

I also tried to use https://github.com/spite/THREE.MeshLine, but I still have the same problem.

How can I fix it?


回答1:


If you update the vertices of your line, you must also update the bounding sphere of your line for frustum culling to work correctly.

line.geometry.computeBoundingSphere();

Alternatively, you can prevent frustum culling of your line by setting

line.frustumCulled = false;

three.js r.75



来源:https://stackoverflow.com/questions/36497763/three-js-line-disappears-if-one-point-is-outside-of-the-cameras-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!