移动相机关闭后,Three.js buffergeometry 消失 [英] Three.js buffergeometry disappears after moving camera to close
问题描述
移动相机关闭后,我的缓冲区几何消失了.您还可以在具有 TrackballControls
的绘图调用 Three.js example 中看到.就我而言,情况要糟糕得多.我的点在 0 到 400 的距离处消失,而我的线在 0 到 100 的距离处消失.我的对象使用简单的几何图形工作正常,但不适用于缓冲几何图形.我发现它与缓冲区几何的质心有关.我尝试使用不同的相机来更改相机范围,但仍然无法正常工作.如何在移动相机后阻止我的物体消失?
My buffergeometry disappears after moving the camera to close. You can also see that in drawcalls Three.js example that has TrackballControls
. In my case it's alot worser. My points disappear at the distance from 0 to 400 and my lines disappear at the distance from 0 to 100. My objects are working fine with a simple geometry but not with a buffergeometry. I found out that it has something to do with the centroid of the buffergeometry. I tryed to use different camera's, to change the camera range and still it doesn't work. How can I stop my objects to disappear after moving the camera?
更新
通过添加 linesMesh.frustumCulled = false;
并删除 geometry.computeBoundingSphere();
使其工作.感谢大家的帮助.
Got it working by adding linesMesh.frustumCulled = false;
and removing geometry.computeBoundingSphere();
. Thanks for all the help.
推荐答案
Three.js 认为您的对象在视锥体之外.添加行
Three.js thinks your object is outside the frustum. Add the line
linesMesh.frustumCulled = false;
它应该阻止它消失.
这篇关于移动相机关闭后,Three.js buffergeometry 消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!