You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
villares edited this page May 24, 2020
·
4 revisions
Nome
screenY()
Exemplos
voidsetup() {
size(100, 100, P3D);
}
voiddraw() {
background(204);
float x =mouseX;
float y =mouseY;
float z =-100;
// Desenha "X" em z = -100 stroke(255);
line(x-10, y-10, z, x+10, y+10, z);
line(x+10, y-10, z, x-10, y+10, z);
// Desenha uma linha em 2D no mesmo valor y// Note a paralaxestroke(102);
line(0, y, 0, width, y, 0);
// desenha uma linha 2D que se ajusta ao balor y do// elemento desenhado em z = -100 stroke(0);
float theY =screenY(x, y, z);
line(0, theY, 0, width, theY, 0);
}
Descrição
Recebe uma posição
tri-diemensional X,Y,Z e retorna o valor Y de onde ela iria
aparecer em uma tela (bi-dimensional).
Sintaxe
screenY(x, y, z)
Parâmetros
x
int ou float: coordenada 3D x a ser mapeada