Hi again! ![]()
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")withibeing 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
imgsrather thanimgbecause it can be confusing
) -
This is because the
timevariable is never used elsewhere other than the line where you subtract50.55. Therefore it does nothing
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
offsetvariable is increasing too much, you can try to reduce theampvariable.