Skip to content

Commit 358d2f8

Browse files
committed
Adapt code for the latest (0.132.2) version of three js
* Replace functions with classes * Remove Geometry class usage * Remove `getInverse` Matrix4 method usage
1 parent 168f9b2 commit 358d2f8

File tree

2 files changed

+247
-251
lines changed

2 files changed

+247
-251
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,16 @@ for (let j = 0; j < Math.PI; j += (2 * Math.PI) / 100) {
5959
}
6060
```
6161

62-
```MeshLine``` also accepts a ```Geometry``` or ```BufferGeometry``` looking up the vertices in it.
62+
```MeshLine``` also accepts a ```BufferGeometry``` looking up the vertices in it.
6363

6464
```js
65-
const geometry = new THREE.Geometry();
65+
const points = [];
6666
for (let j = 0; j < Math.PI; j += 2 * Math.PI / 100) {
67-
const v = new THREE.Vector3(Math.cos(j), Math.sin(j), 0);
68-
geometry.vertices.push(v);
67+
points.push(new THREE.Vector3(Math.cos(j), Math.sin(j), 0));
6968
}
69+
const geometry = new THREE.BufferGeometry().setFromPoints(points);
70+
const line = new MeshLine();
71+
line.setGeometry(geometry);
7072
```
7173

7274
##### Create a MeshLine and assign the points #####

0 commit comments

Comments
 (0)