play with incremental rendering

This commit is contained in:
Stewart Allen 2021-03-04 14:47:24 -05:00
commit 962ac81865
2 changed files with 22 additions and 0 deletions

View file

@ -44,6 +44,16 @@
this.show();
for (let i=0, s=this.slices, len=s.length; i<len; i++) {
s[i].visible = i >= newMin && i <= newMax;
if (s[i].visible) this.lastVis = s[i];
}
}
setLastFraction(frac = 1) {
for (let mesh of this.lastVis.children) {
let geo = mesh.geometry;
let pos = geo.attributes.position;
let len = frac === 1 ? Infinity : Math.round(pos.count * frac);
geo.setDrawRange(0, len);
}
}