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 https://code.sololearn.com/WJpLN9nPjBDV/?ref=app
8/5/2021 3:35:54 PMLily Mea
6 AnswersNew 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 « , » https://code.sololearn.com/Wq46E421aB8w/?ref=app
https://code.sololearn.com/WVedD2DzahRW/?ref=app now this working but this is weird..it seems like for vertex position i have to name my attribute exactly as "position" and cant declare smtg like "attribute vec3 position" in vertex shader..it 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 now..at least it works👌..thanks for your help..
Vasiliy fixed it...but still dont work..