Closed AngeloETH closed 4 years ago
You can set the mesh's color directly like this:
lineMesh.material.uniforms.color.value = new Color('red');
You can set the mesh's color directly like this:
lineMesh.material.uniforms.color.value = new Color('red');
for anyone else that tried implementing this snippet but received Failed to execute 'uniform3fv' on 'WebGLRenderingContext'
in the JS console, according to this issue, the correct syntax is now:
lineMesh.material.uniforms.color.value = new THREE.Color('red');
I want to develop a method can change the color of MeshLine by listening the event from client like this: http://jsfiddle.net/ebeit303/Lfr5my2s/. In the above case, the material is
THREE.LineBasicMaterial
in line29. In MeshLine, the material available isMeshLineMaterial
. However, I can't update color ofMeshLineMaterial
like example. Is it possible to update color dynamically using MeshLine?