# InstancedBufferGeometry with rotations

**URL:** <https://discourse.threejs.org/t/instancedbuffergeometry-with-rotations/9431>\
**Category:** Questions\
**Tags:** instancing\
**Created:** [September 4, 2019, 1:55pm UTC](https://discourse.threejs.org/t/instancedbuffergeometry-with-rotations/9431 "2019-09-04T13:55:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackInk](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@blackInk](https://discourse.threejs.org/u/blackInk)\
**Post date:** [September 4, 2019, 1:55pm UTC](https://discourse.threejs.org/t/instancedbuffergeometry-with-rotations/9431/1 "2019-09-04T13:55:29Z")

</div>

Hi,

I just saw this nice pen:  
[https://codepen.io/prisoner849/pen/qzZaye](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

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [September 4, 2019, 3:01pm UTC](https://discourse.threejs.org/t/instancedbuffergeometry-with-rotations/9431/2 "2019-09-04T15:01:08Z")

</div>

Quick search gave me this link: [GLSL rotation about an arbitrary axis - Neil Mendoza](http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/)  
And here is possibly the worst solution ever 😅  
Added another instanced buffer attribute for speeds of rotation on axes.  
[https://codepen.io/prisoner849/full/eYOeGgV](https://codepen.io/prisoner849/full/eYOeGgV)  
 ![Round-edged%20boxes%20(instancing%2C%20rotation)](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/f/fa0225b274787593f5a6681ba93ea55bdc585e0b.jpeg)

---

<div class="post-metadata">

**Author:** ![blackInk](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@blackInk](https://discourse.threejs.org/u/blackInk)\
**Post date:** [September 4, 2019, 3:18pm UTC](https://discourse.threejs.org/t/instancedbuffergeometry-with-rotations/9431/3 "2019-09-04T15:18:38Z")

</div>

This is so cool!

Thanks bigtime

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [September 4, 2019, 3:46pm UTC](https://discourse.threejs.org/t/instancedbuffergeometry-with-rotations/9431/4 "2019-09-04T15:46:49Z")

</div>

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

[https://threejs.org/examples/webgl\_buffergeometry\_instancing\_dynamic](https://threejs.org/examples/webgl_buffergeometry_instancing_dynamic)
