We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there ! Just new on Processing, i was wondering about how can i do to translate a picture, but on the Z-axis !! I can move it on X and Y, but it can't find out for the Z-axis :(
Here's my code :
PImage img3; float i = 1;
void setup(){
size(1000,1000,P3D); background(0,0,0); img3 = loadImage("logo.png");
} void draw(){
scale(1,1,i);
imageMode(CENTER);
image(img3,width/2,height/2);
i = i/2;
}
I'm sorry if it's an easy question, but i've tried a lot of things, like scale and translate : i just succeeded with some text, but i can't find out for a picture !
Thanks for your replies !!
Answers
Perhaps you want translate?
Hi man, thanks so much for quickly replying ! And it actually works : my bad was to not really study the pushMatrix and popMatrix functions ! I'll study your code, but i'm pretty sure you found my solution :) Thx !
Push/popMatrix are used here to "isolate" the transformations meant to the cube. Try removing them and you will see. :)
oh ok you mean, what's inside the ***Matrix() functions is isolated from the rest of the code ? If i remove them, the rotation on Y-axis are applied to the whole code :D Thanks man you're awesome :)
translate works with x,y,z
so use 0,0,z
0,0,333
but -333 is away from you into the screen