three.js attribute | Sololearn: Learn to code for FREE!


three.js attribute

hi i try to play around with three.js,but seems like i cant get the shader working properly..can someone tell me how to get the geometry attribute properly?i believe this is how people do it but still i got black screen

8/5/2021 3:35:54 PM

Lily Mea

6 Answers

New Answer


Yes, through the .setAttribute() method we refer to the attribute of the .BoxGeometry() method called 'position'. If we want to add our own attributes, we will use the .getAttribute() method.


line 63. no « , »

+1 now this working but this is seems like for vertex position i have to name my attribute exactly as "position" and cant declare smtg like "attribute vec3 position" in vertex works for other attributes though(like "a_colors" in this code)..but i would like to know why?is this intentional or a bug?




Vasiliy yeah..if i use other geometry like box geometry, the attribute working fine but buffergeometry sometimes not..well ,i just name it as position for least it works👌..thanks for your help..


Vasiliy fixed it...but still dont work..