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

Hi again! :wink:

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 :


For the second code, some improvements :

  • The part where you load your images :

    img[0] = loadImage("3.jpg");
    img[1] = loadImage("1.jpg");
    img[2] = loadImage("2.jpg");
    img[3] = loadImage("4.jpg");
    img[4] = loadImage("5.jpg");
    

    can be greatly improved by automating it. As you can see, there is a pattern that can be extracted : img[i] = loadImage("i.jpg") with i being 0, 1, 2, 3, 4…

    For this, check out a previous answer I gave about this :

    Effect not applying on a image in array - #2 by josephh

    (Side note, it’s better to name your array of images imgs rather than img because it can be confusing :wink: )

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

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

    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.