Three.js buffergeometry在移动相机关闭后消失 [英] Three.js buffergeometry disappears after moving camera to close

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

问题描述

移动相机关闭后,我的缓冲几何消失了.您还可以在具有 TrackballControls 的 drawcalls 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屋!

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