Three.js buffergeometry disappears after moving camera to close

和自甴很熟 提交于 2019-11-28 09:29:11

问题


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?

Update

Got it working by adding linesMesh.frustumCulled = false; and removing geometry.computeBoundingSphere();. Thanks for all the help.


回答1:


Three.js thinks your object is outside the frustum. Add the line

linesMesh.frustumCulled = false;

and it should stop it from disappearing.




回答2:


I suggest that you check your camera's .near clipping parameter. Objects close to the camera will naturally be cut off.



来源:https://stackoverflow.com/questions/32855271/three-js-buffergeometry-disappears-after-moving-camera-to-close

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