# Animate geometry states

**URL:** <https://discourse.threejs.org/t/animate-geometry-states/5761>\
**Category:** Questions\
**Tags:** animation, geometry\
**Created:** [January 16, 2019, 3:30pm UTC](https://discourse.threejs.org/t/animate-geometry-states/5761 "2019-01-16T15:30:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisArandas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/luisarandas/32/3487_2.png) [@luisArandas](https://discourse.threejs.org/u/luisArandas)\
**Post date:** [January 16, 2019, 3:30pm UTC](https://discourse.threejs.org/t/animate-geometry-states/5761/1 "2019-01-16T15:30:04Z")

</div>

Hello and good afternoon.  
I wanted to know if it is possible to animate between geometry atributes.  
My code is currently changing geometry scales and positions in space and is triggered by key.events when I click the keyboard.  
My question is if it is possible to animate from one atribute to another when I click Q and then W for example.  
Best, Luis.

---

<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:** [January 16, 2019, 3:50pm UTC](https://discourse.threejs.org/t/animate-geometry-states/5761/2 "2019-01-16T15:50:24Z")

</div>

> [@luisArandas](#):
>
> I wanted to know if it is possible to animate between geometry atributes.

Um, sounds like you are looking for morph target animation. Have you tried this technique already?

[https://threejs.org/examples/webgl\_morphtargets\_sphere](https://threejs.org/examples/webgl_morphtargets_sphere)

---

<div class="post-metadata">

**Author:** ![luisArandas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/luisarandas/32/3487_2.png) [@luisArandas](https://discourse.threejs.org/u/luisArandas)\
**Post date:** [January 16, 2019, 3:53pm UTC](https://discourse.threejs.org/t/animate-geometry-states/5761/3 "2019-01-16T15:53:39Z")

</div>

Thank you very much for the fast response @Mugen87.  
I am going to try it right away, but that raises me another question.  
How can I trigger something with a key.event that runs on paralel like render(). The keycode event (if matches) only happens once.  
Is there a way to go around this?  
Checking the code in the examples atm  
Thank you in advance.  
Best, Luis

---

<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:** [January 16, 2019, 6:32pm UTC](https://discourse.threejs.org/t/animate-geometry-states/5761/4 "2019-01-16T18:32:49Z")

</div>

> [@luisArandas](#):
>
> How can I trigger something with a key.event that runs on paralel like render(). The keycode event (if matches) only happens once.

It’s not problem to start an animation from an event listener. Or do you mean something different? Providing a [live example](https://jsfiddle.net/f2Lommf5/) with your code might help to better understand your question.

---

<div class="post-metadata">

**Author:** ![luisArandas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/luisarandas/32/3487_2.png) [@luisArandas](https://discourse.threejs.org/u/luisArandas)\
**Post date:** [January 16, 2019, 8:38pm UTC](https://discourse.threejs.org/t/animate-geometry-states/5761/5 "2019-01-16T20:38:14Z")

</div>

Hello @Mugen87.  
Tell me if you can see this, or try to understand my question  
[https://jsfiddle.net/luisArandas/hqLzptwx/2/#&togetherjs=nGyPvFs4FA](https://jsfiddle.net/luisArandas/hqLzptwx/2/#&togetherjs=nGyPvFs4FA)  
Best, Luis
