InstancedBufferGeometry with rotations

Hi,

I just saw this nice pen:
https://codepen.io/prisoner849/pen/qzZaye

Now I´m trying to figure out how to add individual rotations to each box?
Any help would be great.

Thanks

Quick search gave me this link: GLSL rotation about an arbitrary axis - Neil Mendoza
And here is possibly the worst solution ever :sweat_smile:
Added another instanced buffer attribute for speeds of rotation on axes.
https://codepen.io/prisoner849/full/eYOeGgV
Round-edged%20boxes%20(instancing%2C%20rotation)

This is so cool!

Thanks bigtime

There is also an official three.js example for this use case:

https://threejs.org/examples/webgl_buffergeometry_instancing_dynamic

1 Like