Skip to content

Commit

Permalink
Faster terrain loading
Browse files Browse the repository at this point in the history
  • Loading branch information
khdlr committed Jan 21, 2025
1 parent a3e7cf8 commit 46e6645
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/ThreeViewer/Terrain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ const TerrainTile = (props) => {
const y = y0 + (ty / divisions) * (y1 - y0)
vertices.push(ElevationManager.toPoint3D(x, y))
// UV mapping for the texture
uvs = uvs.concat([tx / divisions, 1.0 - ty / divisions])
uvs.push(tx / divisions, 1.0 - ty / divisions)
// Triangle indices
if (tx > 0 && ty > 0) {
indices = indices.concat([
indices.push(
i - row - 1,
i - 1,
i - row, // 1st triangle
i - row,
i - 1,
i, // 2nd triangle
])
)
}
i += 1
}
Expand Down

0 comments on commit 46e6645

Please sign in to comment.