sphere spiral in processing

Nikolaus Gradwohl2011-01-09T18:18:12+00:00

This is a little processing sketch featuring a sphere. By moving the mouse it dissolves into a spiral

click here to try it and download the source

sphere_spiral

Tweet This! submit to reddit Digg! Tags: | 1 comments | no trackbacks

See also:

3D mushrooms in processing
foggy wood with recursive trees
isometric labyrinth
mesh made from hexagonal prism - another toxiclib experiment
3D eyes with parametric texture

Trackbacks

Comments

Leave a response

  1. alphachap 2011-01-17T15:30:01+00:00

    Tweaked parameters, added colors:

    int siz=700; float R; float num = 4; float f = 0.5; float rot = 0;

    void setup() { size(siz,siz,P3D); frameRate(25); R = 100*siz/230; }//setup()

    void draw() { float f = map( mouseX, 0, width, -1, 1); float g = map( mouseY, 0, height, -1, 1); background(0); noStroke(); fill(0,255,0); lights(); translate( width/2, height/2); rot += 0.1; rotateY( rot ); beginShape( QUAD_STRIP); for( float a = -360 * num; a<360 * num; a+=16) { float h = R * a / ( 360 * num ); float r = gsqrt( RR - hh); float ca = cos( radians(a)); float sa = sin( radians(a)); float caz = cos( radians(1.5a)); float saz = sin( radians(1.5a)); float x = car; float y = sar; fill(256max(abs(ca),abs(sa)),256min(abs(caz),abs(saz)),256abs(ca)); float a2 = a + 180; float h2 = (R * (a2) / ( f360 * num )); float r2 = fsqrt( RR - h2h2); float ca2 = cos( radians(a2)); float sa2 = sin( radians(a2)); float x2 = fca2r2; float y2 = gsa2r2; vertex( x, h, y ); vertex( x2, h2, y2 ); } endShape(); }//draw()

Leave a comment