Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Three.js buffergeometry disappears after moving camera to close

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.

like image 286
A. I. Avatar asked Sep 29 '15 23:09

A. I.


1 Answers

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

linesMesh.frustumCulled = false;

and it should stop it from disappearing.

like image 57
pailhead Avatar answered Nov 15 '22 11:11

pailhead