Skip to content

Commit

Permalink
Fixed counters attribute calculation spite#114
Browse files Browse the repository at this point in the history
  • Loading branch information
robksawyer committed Dec 23, 2021
1 parent cb69b2b commit 9ca4cbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/THREE.MeshLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@
// and is more performant
for (var j = 0; j < points.length; j++) {
var p = points[j];
var c = j / points.length;
var c = j / (points.length - 1)
this.positions.push(p.x, p.y, p.z);
this.positions.push(p.x, p.y, p.z);
this.counters.push(c);
this.counters.push(c);
}
} else {
for (var j = 0; j < points.length; j += 3) {
var c = j / points.length;
var c = j / (points.length - 1)
this.positions.push(points[j], points[j + 1], points[j + 2]);
this.positions.push(points[j], points[j + 1], points[j + 2]);
this.counters.push(c);
Expand Down

0 comments on commit 9ca4cbb

Please sign in to comment.