
[ad_1]
Using the usual three.js FPS instance of octree implementation with a extra superior mesh, crashes the web page on load.
My first concept is to put in writing a couple of features to avoid wasting the octee information to a file, then load it, to keep away from the additional computational time, corresponding to the next added to the instance, which is barely edited:
this.chootify/*save as object that may be stringified*/ = () => {
return ({
triangles:this.triangles,
field:this.field,
subTrees:this.subTrees.map(ok=>ok.chootify())
});
};
this.load = (awts) => {
this.triangles = awts.triangles
this.field = awts.field
this.subTrees = []
if(awts.subTrees){
awts.subTrees.forEach(ok=>{
var aw = new AwtsOctTree(ok.field)
aw.load(ok)
this.subTrees.push(aw)
})
}
}
after which I used to be planning on loading it in a background thread.
However I did not understand that even for a reasonably easy constructing mesh, the octree file would take up 230mb of area when stringified (instance: run features to worldOctree from console to check).
When utilizing a extra complicated mesh with stairs and so forth. it utterly crashes the online web page utilizing the usual build-on-runtime technique.
I do not know optimize this, any ideas?
[ad_2]