threejs-meshline
threejs-meshline copied to clipboard
AFRAME get uniforms error
I've got the same thing happening with the other version, but when I try and add this to an Aframe element I get
three.js:22549 Uncaught TypeError: Cannot read property 'getUniforms' of undefined
Here is my code
const vertices = this.data.path.map(pos => AFRAME.utils.coordinates.parse(pos))
const line = new MeshLine()
line.setVertices(vertices)
const material = new MeshLineMaterial({
color: new AFRAME.THREE.Color(this.data.color),
lineWidth: this.data.width,
sizeAttenuation: true,
resolution: new AFRAME.THREE.Vector2(window.innerWidth, window.innerHeight),
})
const mesh = new AFRAME.THREE.Mesh(line, material)
this.el.object3D.add(mesh)
I've never used Aframe before but can look into. It would be easier if you could set up a code sandbox for me?