BufferGeometry need to be called with `new`
See original GitHub issueThe code uses https://github.com/spite/THREE.MeshLine/blob/master/src/THREE.MeshLine.js#L12
THREE.BufferGeometry.call(this)
however recently threejs has some changes to make use of ES6 classes
All central engine components like Object3D, BufferGeometry or ShaderMaterial are now ES6 classes.
https://github.com/mrdoob/three.js/wiki/Migration-Guide#127--128
need an update now.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:37
- Comments:5
Top Results From Across the Web
BufferGeometry – three.js docs
To read and edit data in BufferGeometry attributes, see BufferAttribute ... You will have to call .dispose(), and create a new instance of...
Read more >Three.js Custom BufferGeometry
BufferGeometry on the other hand uses named BufferAttribute s. ... If a vertex needs any part to be different then it must be...
Read more >Updating THREE.Geometry to THREE.BufferGeometry
If you used the THREE.Geometry in any of your custom code, and you want to use THREE r125 or later, then you will...
Read more >The Buffer Geometry Constructor in threejs
The buffer geometry constructor in threejs and what to know first ... I now just need to add this geometry to a mesh...
Read more >Three.js – Buffer Geometry Art - YouTube
In this JavaScript tutorial, we'll build a colorful work of abstract art with basic JavaScript in THREE.jsHere's the final *sculpture*: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello! Thank you very much for this amazing library @spite. I made a new version of a library using vite and typescript. I would be happy to PR it on your repo but I went a bit yolo and had to use --allow-unrelated-histories. https://github.com/utsuboco/THREE.MeshLine
Temporary I published it on npm under the name meshline. It should work the same way, and it now exports es(2.89kb brotli) and umd(3.13kb).
If anyone could take over in cleaning the code that would be amazing.
Here a working example with react-three/fiber: https://codesandbox.io/s/confetti-typescript-meshline-0f4mi?file=/src/index.tsx
EDIT: Added typescript definitions in 2.0.3
interested in this fix