Language \ Environment \ Comparison
 
Index
 
  The Processing 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: reas at groupc.net
Name  

screenY()

   
Examples  
void loop() { 
  float x = mouseX; 
  float y = mouseY; 
  float z = -100; 
 
  // temporary kludge to kick P5 into 3D drawing 
  translate(0, 0, 0); 
  
  stroke(0); 
  float theY = screenY(x, y, z); 
  // Draw 2D line to match 3D position 
  line(0, theY, width, theY);    
  
  stroke(255); 
  // Draw line in 3D 
  line(x-10, y, z, x+10, y, z);  
 
  // Draw line in 2D as comparison 
  line(0, y, width, y);    
}  
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  
var = screenY(x, y, z)
   
Parameters  
var   float: any legal variable name

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()
   
© 2004 - 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas