Three.js line disappears if one point is outside the camera

I created the line as described in the docs: http://threejs.org/docs/#Reference/Objects/Line .

But when one of the points of the line is outside the camera, the line disappears.

I also tried using https://github.com/spite/THREE.MeshLine , but I still have the same problem.

How can i fix this?

+4
source share
1 answer

If you update the vertices of your line, you must also update the bounding sphere of your line in order to reject the correct line segment.

line.geometry.computeBoundingSphere();

Alternatively, you can prevent the truncation of your line from being rejected by setting

line.frustumCulled = false;

three.js r.75

+9

All Articles