# Simple example of 3D movement following a point?

**URL:** <https://discourse.processing.org/t/simple-example-of-3d-movement-following-a-point/12361>\
**Category:** Coding Questions\
**Created:** [June 28, 2019, 3:32pm UTC](https://discourse.processing.org/t/simple-example-of-3d-movement-following-a-point/12361 "2019-06-28T15:32:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 28, 2019, 5:12pm UTC](https://discourse.processing.org/t/simple-example-of-3d-movement-following-a-point/12361/2 "2019-06-28T17:12:17Z")

</div>

Consider:  
[https://processing.org/reference/modelX\_.html](https://processing.org/reference/modelX_.html)

Add this snippet to code (from above) and observe:

```auto
  // draw another box at the same (x, y, z) coordinate as the other
  pushMatrix();
  translate(x, y, z);
  stroke(255, 0, 0);
  box(50);
  println("1:", x, y, z);
  popMatrix();
  println("2:", x, y, z);
  stroke(255, 255, 0);
  strokeWeight(10);
  point(x, y, z);
  strokeWeight(1);
}

```

Tell us more.

I never used modelX() so this will be useful for me!

🙂

---

_[View the full topic](https://discourse.processing.org/t/simple-example-of-3d-movement-following-a-point/12361)._
