-
... ALLED! See also: RedMRCM , RedLTurtle , RedMandelbrot Description Plotting with Pen . After Flake - "The Computational Beauty of Nature". Class Methods . new Arguments: drawFunc A Function that draws something. It is passed a Point argument ...
-
... rand2, mass, mass*10); //world,loc,vel,acc,mass,size }.dup(n); //--loop w.draw{ Pen.strokeColor= Color.grey(0.5); Pen.strokeRect(Rect.aboutRedVector3D(RedVector[width*0.5, height*0.5, depth], width*0.5, width, height, depth, s, f)); Pen.str ...
-
... contain(~objA); world.contain(~objB); bary= ~objA.barycenter(~objB); //--render Pen.strokeColor= Color.magenta; Pen.strokeOval(Rect.aboutRedObject2D(~objA)); Pen.strokeColor= Color.cyan; Pen.strokeOval(Rect.aboutRedObject2D(~objB)); Pen.fil ...
-
... one of the values of QToolButtonStyle . Discussion: ( ~icon = Image(64).draw({ Pen.fillOval(Rect(0, 0, 64, 64)) }); ~styles = QToolButtonStyle.classVarNames; ~tool = ToolBar( MenuAction("Text") .icon_(~icon) .action_({ ~tool.toolButtonStyl ...
-
... sys.wave.wrapAt(i)]); }; //sys.addForce(world.gravity); sys.update; //--render Pen.fillColor= Color.grey(1, 0.5); //Pen.strokeColor= Color.grey(1, 0.5); //Pen.moveTo(sys.objects[0].loc.asPoint); sys.do{|o, i| Pen.fillOval(Rect.aboutRedObje ...
-
//render pendulums - takes a little while ( var width= 640, height= 480, w, wgrav, world, n= 50, ploc; //--world w= RedWindow("pendulum test3", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0.98]; world= RedWorld(RedVector2D[wi ...
-
... tor2D[0, 0], 1.5, 10); //world,loc,vel,acc,mass,size }.dup(n); //--loop w.draw{ Pen.strokeColor= Color.green; Pen.strokeOval(Rect.aboutRedObject2D(att)); Pen.strokeColor= Color.white; world.objects.do{|o| if(o!=att, { o.addForce(o.gravityFo ...
-
//many pendulums in a world with gravity ( var width= 300, height= 300, w, wgrav, world, n= 100, ploc; //--world w= RedWindow("pendulum test3", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0]; world= RedWorld3(RedVector2D[widt ...
-
... p| if(p!=o, { o.couple(p); }); }; }; world.objects.do{|o| o.update}; //--render Pen.width= 5; Pen.strokeColor= Color.black; Pen.fillColor= Color.white; world.objects.do{|o| var p, x, y; p= o.loc.asPoint; Pen.addOval(Rect.aboutPoint(p, o.siz ...
-
... anFocus = false; c.drawFunc = { Color.grey(0.8).set; // draw the speaker layout Pen.translate(200,200); ((actPoint.theta + (0.5pi)).wrap2(pi) * rtoang).round(0.01).asString.drawCenteredIn( Rect.aboutPoint(0@170, 30, 10), Font.new("Arial", 1 ...