martinlaxenaire / curtainsjs

curtains.js is a lightweight vanilla WebGL javascript library that turns HTML DOM elements into interactive textured planes.
https://www.curtainsjs.com/
MIT License
1.68k stars 111 forks source link

How to assign values ​​to an element of a vector? #46

Closed AlainBarrios closed 4 years ago

AlainBarrios commented 4 years ago

I was observing that in new versions of the library I assign values ​​to the items but it doesn't detect. Another problem is that now i can't use gsap to change vector values

this is a example not works

this.bufferTrail.uniforms.mousepos.value[0] = this.mouse.x
this.bufferTrail.uniforms.mousepos.value[1] = this.mouse.y

this works

this.bufferTrail.uniforms.mousepos.value = [this.mouse.x, this.mouse.y]
martinlaxenaire commented 4 years ago

Hey @AlainBarrios,

you're right, it seems we can't update array uniforms values independently. I've managed to fix this bug. I'll close this issue as soon as I find some time to commit the update.

Thanks!

Cheers,

martinlaxenaire commented 4 years ago

Fixed with version 6.2.2