Open main menu

CDOT Wiki β

FSOSS 2010/processing.js/sphere1

Revision as of 14:13, 26 October 2010 by Asalga (talk | contribs) (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…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
/*
  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);
}