shawn0326 / three.path

three.path is a three.js extension which provides a 3D path geometry builder.
MIT License
127 stars 41 forks source link

Path randomly disappears. #16

Closed shubsangale closed 5 months ago

shubsangale commented 5 months ago

My path points are dynamically added on runtime, when camera is zoomed in and out mostly from top view the path is disappeared

This is how Path Geometry is created this.lineGeometry = new PathTubeGeometry({ pathPointList: this.pointList, options: { radius: this.radius }, usage: THREE.DynamicDrawUsage });

This is how Path Geometry is updated if (this.lineGeometry) { this.lineGeometry.update(this.pointList, { radius: this.radius, usage: THREE.DynamicDrawUsage, }); }

Here is video.

https://github.com/shawn0326/three.path/assets/159766816/7af54ff8-4898-4d6e-8d23-80c47c310e9e

shawn0326 commented 5 months ago

May be caused by frustum culling. Make sure to recalculate the bounding box and bounding sphere after updating the geometry:

geometry.computeBoundingBox();
geometry.computeBoundingSphere();

Or just turn off frustum culling: mesh.frustumCulled=false