Rotating Möbius-Strip in processing
This is a rotating 3D Möbius-Strip in processing
Click here to try and download the source
See also:
3D mushrooms in processing
foggy wood with recursive trees
isometric labyrinth
mesh made from hexagonal prism - another toxiclib experiment
sine function spider
foggy wood with recursive trees
isometric labyrinth
mesh made from hexagonal prism - another toxiclib experiment
sine function spider
Added colors:
float a = 0; void setup() { size(400,400,P3D); } void draw() { float f = map( mouseX, 0, width, -3, 3); float g = map( mouseY, 0, height, -3, 3); background(0); lights(); noStroke(); fill(128,255,0); float r = 100; translate( width/2, height/2 ); a += 0.01; rotateY( a ); rotateX( a ); beginShape( QUAD_STRIP ); for ( int i =0; i < 37; i++) { float x = fcos( radians( i * 5.0)) * 30; float z = gsin( radians( i * 5.0)) * 30; fill(256-256abs(18-i)/18,128,256abs(18-i)/18); float xa = ( r + x ) * cos( radians( i * 10.0 )); float ya = ( r + x ) * sin( radians( i * 10.0 )); float xb = ( r - x ) * cos( radians( i * 10.0 )); float yb = ( r - x ) * sin( radians( i * 10.0 )); vertex( xa, ya, z ); vertex( xb, yb,-z ); } endShape(CLOSE); }