screenY() \ Language (API) \ Processing 1.0
Search processing.org:
Language (A-Z) \
Libraries \
Tools \
Environment \
Compare \
Troubleshooting
Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Name
screenY()
Examples
void setup() {
size(100, 100, P3D);
}
void draw() {
background(204);
float x = mouseX;
float y = mouseY;
float z = -100;
// Draw "X" at 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);
// Draw line in 2D at same y value
// Notice the parallax
stroke(102);
line(0, y, 0, width, y, 0);
// Draw 2D line to match the y value
// element drawn at z = -100
stroke(0);
float theY = screenY(x, y, z);
line(0, theY, 0, width, theY, 0);
}
Description
Takes a three-dimensional X, Y, Z position and returns the Y value for where it will appear on a (two-dimensional) screen.
Syntax
screenY(x, y, z)
Parameters
x
int or float: 3D x coordinate to be mapped
y
int or float: 3D y coordinate to be mapped
z
int or float: 3D z coordinate to be mapped
Returns
float
Usage
Web & Application
Related
screenX()screenZ()
Updated on November 22, 2008 08:39:26pm PST
Processing was initiated by Ben Fry and Casey Reas. It is developed by a small team of volunteers.
© Info \
Site hosted by Media Temple!
Wyszukiwarka
Podobne podstrony:
Chemical Composition and in Vitro Antifungal Activity ScreeningINFOCUS SCREENPLAY 4800FANUC21IT ON SCREEN MDI PANELscreen categories editcollectionbadanie przesiewowe screeningwięcej podobnych podstron