将相机关闭后,Three.js的buffergeometry消失了 [英] Three.js buffergeometry disappears after moving camera to close

查看:466
本文介绍了将相机关闭后,Three.js的buffergeometry消失了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关闭相机后,我的缓冲几何消失了.您还可以在具有TrackballControls的Three.js 示例中看到.就我而言,情况要糟得多.我的点在0到400的距离处消失,我的线在0到100的距离处消失.我的对象在简单的几何体上工作正常,但在缓冲几何体下工作正常.我发现它与buffergeometry的质心有关.我尝试使用其他相机来更改相机范围,但仍然无法正常工作.移动相机后如何阻止物体消失?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆