# Como hacer movimientos avanzados

**URL:** <https://discourse.processing.org/t/como-hacer-movimientos-avanzados/19569>\
**Category:** Español\
**Created:** [April 9, 2020, 9:23am UTC](https://discourse.processing.org/t/como-hacer-movimientos-avanzados/19569 "2020-04-09T09:23:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [April 17, 2020, 6:50pm UTC](https://discourse.processing.org/t/como-hacer-movimientos-avanzados/19569/4 "2020-04-17T18:50:48Z")

</div>

Hay muchas maneras. Para movimientos con guiones simples, como los movimientos en su video de ejemplo, un método es hacer una lista de puntos (“waypoints”). Puede usar PVector.

Luego deslice un objeto entre los puntos de la lista. Para hacer eso, use una función como esta:

```auto
PVector lerpVectors(float amt, PVector... vecs) {
  if(vecs.length==1){ return vecs[0]; }
  float unit = 1.0/(vecs.length-1);
  return PVector.lerp(vecs[floor(amt / unit)], vecs[ceil(amt / unit)], amt%unit/unit);
}

```

Aquí hay una discusión previa:

> [@Steering a Shape along a pathway](https://discourse.processing.org/t/steering-a-shape-along-a-pathway/17787):
>
> Hello all, I want to steer a shape along a pathway. Let’s say a spaceship that first goes along x axis and when at a certain point stops and rotates slowly around its axis and then starts in another direction. Like a framework with list of timers and different commands for the time periods. Ah, I must have done something like this… But has anyone an example for this? Thanks! Chrisir

---

_[View the full topic](https://discourse.processing.org/t/como-hacer-movimientos-avanzados/19569)._
