Difference between revisions of "FSOSS 2010/processing.js/sphere1"

From CDOT Wiki
Jump to: navigation, search
(Created page with '<source lang="JavaScript"> FSOSS 2010 Andor Salga Example of sphere and sphereDetail: import processing.opengl.*; void setup(){ size(400, 400, OPENGL); } void draw…')
 
 
(One intermediate revision by the same user not shown)
Line 24: Line 24:
 
}
 
}
 
</source>
 
</source>
 +
[http://studio.sketchpad.cc/01VrOOPONA Run me]

Latest revision as of 16:03, 27 October 2010

/*
  FSOSS 2010
  Andor Salga
  Example of sphere and sphereDetail
*/
import processing.opengl.*;

void setup(){
  size(400, 400, OPENGL);
}

void draw(){
  background(#336699);
 
  // center in the canvas
  translate(width/2, height/2, 150);
 
  rotateY( frameCount/250.0f );

  sphereDetail((int)(mouseX/(float)width * 50));

  sphere(50);
}

Run me