# Articulated Instance

**URL:** https://discourse.libcinder.org/t/articulated-instance/229
**Category:** Using Cinder
**Created:** [August 17, 2016, 5:23pm UTC](https://discourse.libcinder.org/t/articulated-instance/229 "2016-08-17T17:23:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![xumo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/xumo/32/75_2.png) [@xumo](https://discourse.libcinder.org/u/xumo)
#### Post date: [August 17, 2016, 5:23pm UTC](https://discourse.libcinder.org/t/articulated-instance/229/1 "2016-08-17T17:23:06Z")

</div>

Hi, is there a good example to draw and animate articulated instances?

I’m moving a drawing tourtles and now there is a 30-40 limit before dropping frames. I’ve done it the direct CPU way, drawing 6 textures (Head, body and 4 legs). I’m sure there is a GPU way to do it.

My idea is to animate a Vbo with a vertex shader, then render it with geometry shader making 6 quads, one for each texures.

I’ve tried hacking tha ParticleGPU example but I’m stuck at the shader in the rendering stage. I cannot read the custom varying of the Vbo that I’v already update in a previous vertes shader.

Any hint will be appreciated.

---

<div class="post-metadata">

### Author: ![mike](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/mike/32/56_2.png) [@mike](https://discourse.libcinder.org/u/mike)
#### Post date: [August 18, 2016, 11:52pm UTC](https://discourse.libcinder.org/t/articulated-instance/229/2 "2016-08-18T23:52:38Z")

</div>

So, just to make sure I understand what you’re trying to accomplish: you need to draw 30-40 quads that move independently and each have their own texture, correct?

If that’s the case, it might be easier to just use instanced drawing via a `gl::BatchRef` that contains a rectangular mesh. You could load all of the different textures into a texture array and use a custom per-instance attribute that denotes which slice of the texture array corresponds to each quad’s texture.

---

<div class="post-metadata">

### Author: ![xumo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/xumo/32/75_2.png) [@xumo](https://discourse.libcinder.org/u/xumo)
#### Post date: [August 31, 2016, 5:27pm UTC](https://discourse.libcinder.org/t/articulated-instance/229/3 "2016-08-31T17:27:51Z")

</div>

Sorry for the silence gap, thanks for the reply.

I just did not have time to explore this per instance attribute solution. I just made the old CPU way. I just could draw very little agents but the result wasn’t to bad.

I post a video of the result and hope to have time to do it the proper way. This is a permanent installation in Mexico.

Thanks again.
