Skip to content

Commit

Permalink
examples/clip: Fix excess compute, clean up, cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-devel committed May 22, 2024
1 parent eb87f12 commit 5bc6a5b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/clip/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@
for (let j = 0; j < hVerts; j++) {
const row = [];

let x, y, z;
let idx, x, y, z;
for (let i = 0; i < wVerts; i++) {
x = arr[3 * (j * wVerts + i)];
y = arr[3 * (j * wVerts + i) + 1];
z = arr[3 * (j * wVerts + i) + 2];
idx = 3 * (j * wVerts + i);
x = arr[idx];
y = arr[idx + 1];
z = arr[idx + 2];
if (xMin < x && x < xMax && yMin < y && y < yMax) { // inside bbox
row.push(x, y, z);
}
Expand Down Expand Up @@ -124,7 +125,7 @@

//---- how to use `clipTerrainRgb()`
const { proj, bbox } = tgeo.getProjection(origin, radius);
clipTerrainRgb(terrain, proj, bbox); // TODO adjust texture
clipTerrainRgb(terrain, proj, bbox); // incomplete, TODO adjust texture
//----
console.log('terrain:', terrain);

Expand Down

0 comments on commit 5bc6a5b

Please sign in to comment.