# How to make my images spin around an ellipse in P3D?

**URL:** <https://discourse.processing.org/t/how-to-make-my-images-spin-around-an-ellipse-in-p3d/28745>\
**Category:** Coding Questions\
**Created:** [March 22, 2021, 11:28pm UTC](https://discourse.processing.org/t/how-to-make-my-images-spin-around-an-ellipse-in-p3d/28745 "2021-03-22T23:28:14Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [March 24, 2021, 8:47pm UTC](https://discourse.processing.org/t/how-to-make-my-images-spin-around-an-ellipse-in-p3d/28745/4 "2021-03-24T20:47:44Z")

</div>

> [@Rindoom](#):
>
> Hey, josephh. It’s nice to see you again here. Hope you are doing well and safe. 💪

Hi again! 😉

> [@Rindoom](#):
>
> I am not quite sure how to manipulate my image coordinates with this newly added Z-axis?

This is exactly right, I forgot that the `image()` function doesn’t accept `z` coordinate argument!

You can refer to this previous thread to see how to display images properly in P3D :

> [@Show Image in P3D space?](https://discourse.processing.org/t/show-image-in-p3d-space/2419):
>
> I have a P3D window in full screen mode: fullScreen(P3D). I am rotating a 3d model around, and would like to overlay an image over the screen, so that it is always on top of all elements. How can I do this? I’ve tried just image, and it doesn’t work for me.

* * *

For the second code, some improvements :

- The part where you load your images :

- 

> [@Rindoom](#):
>
> so I thought it will be a good idea to use `float time -=` Sadly I didn’t make any difference.

This is because the `time` variable is never used elsewhere other than the line where you subtract `50.55`. Therefore it does nothing 😋

> [@Rindoom](#):
>
> At this point, all of the images are spinning way too fast.

What drives the movement of the images is relies in this expression :

```auto
sin(angle *i + offset)

```

If you think about it, the trigonometric functions are oscillating with a period of `TWO_PI` (the time it takes to go from -1 to 1 and go back and if you go too fast, it’s oscillating very fast.

Therefore the `offset` variable is increasing too much, you can try to reduce the `amp` variable.

---

_[View the full topic](https://discourse.processing.org/t/how-to-make-my-images-spin-around-an-ellipse-in-p3d/28745)._
