Submit Browse Random
Anonymous Login RSS

SuperCollider Code

All (764) Code (64) Doc (175) Help (16) Quark (509) SCDoc ↗ Forum ↗ Google ↗
  1. 110-bounce_objects Doc

    //objects shoot out off each other. with friction and world damping to compensate. ( var width= 300, height= 300, w, wgrav, world, n= 18; //--world w= RedWindow("bounce test", Rect(128, 64, width, height)).front; wgrav= RedVector2D[-0.1, 0. ...

  2. 020-friction Doc

    ... el= obj.vel*0; //stop object }); }); obj.update; world.contain(obj); //--render Pen.fillColor= Color.red; Pen.fillRect(fric); Pen.strokeColor= Color.white; Pen.strokeRect(Rect.aboutRedObject2D(obj)); }; w.play; CmdPeriod.doOnce({w.close}); ...

  3. 026-multiple_barycenter Doc

    ... { o.addForce(o.gravityForce(oo)); }); }; o.update; world.contain(o); //--render Pen.strokeColor= Color.blue; Pen.strokeOval(Rect.aboutRedObject2D(o)); }; world.objects.do{|o, i| bary= bary+(o.loc*o.mass); }; bary= bary/totalMass; Pen.fillCo ...

  4. 021-superfriction Doc

    ... el= obj.vel*0; //stop object }); }); obj.update; world.contain(obj); //--render Pen.fillColor= Color.green; Pen.fillRect(fric); Pen.strokeColor= Color.white; Pen.strokeRect(Rect.aboutRedObject2D(obj)); }; w.play; CmdPeriod.doOnce({w.close}) ...

  5. 009-multiple-3d_synth Doc

    ... e }.dup(n); synths= {Synth("fm3Dtest", [\amp, 0.5/n])}.dup(n); //--loop w.draw{ Pen.strokeColor= Color.grey(0.5); Pen.strokeRect(Rect.aboutRedVector3D(RedVector[width/2, height/2, depth], width/2, width, height, depth, ss, ff)); Pen.strokeC ...

  6. Morph Doc

    ... width; height = me.bounds.height; q.morph.updatedContacts.keysValuesDo({|k, me| Pen.color = contactColor; Pen.addOval(Rect.aboutPoint(([me.x, me.y] * [width, height]).asPoint, me.force * 1000, me.force * 1000)); Pen.fill; Pen.color = avgCol ...

  7. 232-3Dline Doc

    ... a*2]; line.update; //--render line.render(1, 100); //1= exaggerate, 2= standard Pen.translate(width*0.5, height*0.5); Pen.strokeColor= Color.white; line.drawOutlines; Pen.fillColor= Color.white; line.draw(10); //dotSize }; w.play; CmdPeriod ...

  8. 234-3Dplane Doc

    ... 2]; plane.update; //--render plane.render(1, 300); //1= exaggerate, 2= standard Pen.translate(width*0.5, height*0.5); Pen.strokeColor= Color.white; plane.drawOutlines; Pen.fillColor= Color.white; plane.draw(10); //dotSize }; w.play; CmdPeri ...

  9. 239-4Dhypercubes Doc

    ... c,vel,acc,mass,size hypercubes= {|i| Red4DTesseract()}.dup(n); //--loop w.draw{ Pen.strokeColor= Color.white; Pen.fillColor= Color.green(1, 0.25); world.objects.do{|o, i| thetas[i]= thetas[i]+speeds[i]; hypercubes[i].rotation= RedVector.new ...

  10. 018-repulsive_discrete Doc

    ... and], nil, 15, pixelSize); //world,loc,vel,acc,mass,size }; }; //--loop w.draw{ Pen.smoothing_(false); Pen.strokeColor= Color.green; rep.loc= w.mouse/[wn, hn]; Pen.strokeRect(Rect.aboutPoint(rep.loc.round.asPoint*[wn, hn], pixelSize, pixelS ...

prev 1 2 3 4 5 6 7 8 9 10 next

SuperCollider home doc forum wiki git legacy help book

contact | by vividsnow