Len White Len White - 4 months ago 72
Javascript Question

Add Attribute to Three.js Object

I want to maintain some information with shapes I'm creating. I use an HTML canvas for the texture, so I know I can keep the values in the element attributes arrays of the canvases. I'm wondering though, is there a more straight-forward way of maintaining attributes that works for all Three.js shapes regardless of how they are constructed?


To be clear as to the correct answer, prisoner849 provided it in the comment he made to another response: use the THREE.Mesh.userData property.