I have a txt file ,data look like this: 451414.187324745,6782377.6856853,-2069.84838867188,451403.456449169,6782481.37422956,-2065.95043945313,451477.223852634,6782483.15304335,-2048.16259765625,451496.129265577,6782382.07128944,-2054.52124023438,451325.147937709,6782358.683375,-2019.99914550781,451318.483355113,6782463.29998053,-2018.92834472656,451402.64727695,6782465.87609929,-2006.38549804688,451413.279804756,6782362.9702961,-2008.46875,
The data is a box’s 8 points .
How to optimize when I use BufferGeometry to draw it?
Wdym by optimise? Drawing 8 points shouldn’t require any kind of optimisations - GPU will barely notice them at all ![]()
The txt contains 70000 lines that every line contains 8 points ,every point also contains x,y,z position, so how to optmize ?
What’s the context of this data, is it a geometry, spatial coordinates?.. Meanwhile you can either Zip it, or load it in chunks (progressive loading…)
Have you already worked out how to parse the array into a BufferGeometry, and are just trying to make it faster/smaller now? If it’s not working yet (I can’t tell from your question) then I wouldn’t worry about optimizing yet.
Once you are ready to optimize though: Plain text is not an efficient encoding for large floating-point arrays, to optimize that you’ll want a binary representation, and not to load the .txt file in the browser at all. A quick option here would be to use a short nodejs script:
…which could be executed with something like node my-script.js. That will be smaller than .txt to start, and any additional zipping or compression will reduce it even further.
A somewhat more advanced option would be encode the point cloud as a .glb, see this example:
Then it becomes possible to use compression like meshopt that is optimized further for 3D point data.
Thank you answer my question
I have another one question.I create a plane , when I scroll mouse ,I would like this plane always keeps same size. It likes cesuim’s ground which keeps full screen that unaffected by mouse scrolling.