Skip to content

Commit

Permalink
Merge pull request #143 from NZhuravlev/master
Browse files Browse the repository at this point in the history
Adapt code for the latest (0.132.2) version of three js
  • Loading branch information
spite authored Feb 27, 2022
2 parents 168f9b2 + 358d2f8 commit b49ae60
Show file tree
Hide file tree
Showing 2 changed files with 247 additions and 251 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ for (let j = 0; j < Math.PI; j += (2 * Math.PI) / 100) {
}
```

```MeshLine``` also accepts a ```Geometry``` or ```BufferGeometry``` looking up the vertices in it.
```MeshLine``` also accepts a ```BufferGeometry``` looking up the vertices in it.

```js
const geometry = new THREE.Geometry();
const points = [];
for (let j = 0; j < Math.PI; j += 2 * Math.PI / 100) {
const v = new THREE.Vector3(Math.cos(j), Math.sin(j), 0);
geometry.vertices.push(v);
points.push(new THREE.Vector3(Math.cos(j), Math.sin(j), 0));
}
const geometry = new THREE.BufferGeometry().setFromPoints(points);
const line = new MeshLine();
line.setGeometry(geometry);
```

##### Create a MeshLine and assign the points #####
Expand Down
Loading

0 comments on commit b49ae60

Please sign in to comment.