-
//many pendulums in a world with gravity ( var width= 300, height= 300, w, wgrav, world, n= 50, ploc; //--world w= RedWindow("pendulum test2", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0.98]; world= RedWorld3(RedVector2D[wi ...
-
... 0.001))*0.5+0.5*width, cos(w.frame*0.027+cos(w.frame*0.0012))*0.5+0.5*height ]; Pen.strokeColor= Color.yellow; Pen.strokeOval(Rect.aboutRedObject2D(rep)); Pen.strokeColor= Color.white; world.objects.do{|o, i| if(o!=rep, { o.addForce(o.gravi ...
-
... nt( super.bounds.width / 2, super.interactionRect.bottom - symbolPosition ); }; Pen.strokeColor_(super.mainColor); Pen.width_(super.outlineSize); if(thisDisplayLine != \none) { if(thisDisplayLine == \full) { if(super.orientation == \horizon ...
-
... el, 0, mass, mass*10); //world,loc,vel,acc,mass,size }.dup(n); //--loop w.draw{ Pen.fillColor= Color.grey(0, cnt.fold(0, 500)/10000); Pen.fillRect(Rect(0, 0, width, height)); world.objects.do{|o| world.objects.do{|oo| var dist= o.loc.distan ...
-
... by * holding a UserView internally. This view is created upon instantiation * depending on the current GUI scheme. * * Any unknown calls are automatically forwarded to it, and event hooks are * patched to consistently provide the base view ...
-
... urtle implementation. t = Turtle .new ( t.init; t.to(100@100); t.turn(0.5pi); t.penDown; t.forward(100); t.penUp; t.turn(-0.5pi); t.forward(100); t.penDown; t.forward(100); ) w = SCWindow .new.front ( w.drawHook = { Pen .use { t.stroke; Col ...
-
... bounds.width )) @ (array[1].linlin(range.neg,range,bounds.height,0,\none)); }); Pen.color_( Color.white.alpha_(0.25) ); Pen.roundedRect( bounds, [6,6,0,0] ).fill; Pen.color = Color.gray(0.2).alpha_(0.5); //Pen.strokeRect( bounds.insetBy(-1, ...
-
... soundfield player - for auditioning the soundfield transforms var <audition, >iOpenedAudition = true, <pwPlaying = false, <pwAzim = 0; *new { | numDisplayPoints = 12 | ^super.newCopyArgs(numDisplayPoints).prInit; } prInit { var directions; ...
-
... |x| x.notNil}; }.flat; syns= {Synth(\imp2)}.dup(n); //--loop w.draw{ //--render Pen.smoothing= true; Pen.strokeColor= Color.white; sprs.do{|spr| spr.update; //--render springs Pen.moveTo(spr.object.loc.asPoint); Pen.lineTo(spr.target.loc.as ...
-
... ource.gui(layout ?? {Window(~name.value, bounds).front}, bounds) }, draw: { arg pen, bounds, style; pen.color = style['fontColor']; pen.font = style['font']; if(style['center'], { pen.stringCenteredIn(~name.value, bounds) }, { pen.stringLef ...