-
... cceptsMouse_(false).drawFunc_({ var b = canvas.bounds(); var str = text.string; Pen.translate(b.center.x, b.center.y); Pen.fillColor = text.palette.baseText.alpha_(0.1); str.do { |c| var x = 40.0.rand + 10.0; var r = c.asString.bounds.cente ...
-
... nce Methods . calc Calculate points from array. . draw Start drawing at current Pen position. . makeWindow Create a new window and plot the points. . array Data to be plotted. . normalize Normalize points after -calc . . points Coordinates ...
-
... s methods new Inherited class methods Instance methods draw play stop resize isOpen mouse isPlaying clear userView Inherited instance methods Examples Classes (extension) | Red > redUniverse'>redUniverse RedWindow Extension wrapper for User ...
-
//a pendulum in 3d ( var width= 300, height= 300, depth= 300, w, wgrav, world, obj, ploc, s= 1, f= 0.1; //--world w= RedWindow("pendulum 3d", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0, 0]; world= RedWorld(RedVector3D[widt ...
-
//double pendulum //https://www.myphysicslab.com/pendulum/double-pendulum-en.html ( var width= 300, height= 300, w, wgrav, world, ploc, angularAccel1, angularAccel2; //--world w= RedWindow("double pendulum", Rect(128, 64, width, height)).fr ...
-
... w.drawFunc= { var colors= {|i| Color.hsv(i/a.k, 1, 1)}.dup(a.k); b.do{|vec, i| Pen.fillColor= colors[a.classifications[i]]; Pen.fillRect(Rect.aboutRedVector2D(vec, 1)); }; Pen.fillColor= Color.white; a.centroids.do{|cent, i| Pen.strokeColo ...
-
... nder2D; }); o.addForce(~world.gravity); o.update; ~world.contain(o); //--render Pen.fillColor= Color.grey(1-(i/~n), 0.5); Pen.fillOval(Rect.aboutRedObject2D(o)); }; }; ~win.play; CmdPeriod.doOnce({~win.close}); ) //--livecoding swapping wor ...
-
... leBoundaryCollisions.value(b); handleBoundaryCollisions.value(c); physics.tick; Pen.color= Color.black; Pen.strokeOval(Rect.aboutPoint(Point(mouse.position.x, mouse.position.y), 17.5, 17.5)); Pen.fillOval(Rect.aboutPoint(Point(b.position.x, ...
-
... 2D[width, height], wgrav, 20, 0.25); //dim,grav,maxvel,damp //--loop ~win.draw{ Pen.strokeColor= Color.white; ~world.objects.do{|o| o.addForce(o.world.gravity); o.update; o.world.contain(o); //--render Pen.strokeRect(Rect.aboutRedObject2D(o ...
-
... ds Inherited class methods Instance methods draw play stop resize background isOpen mouse isPlaying userView animate frame frameRate Inherited instance methods Examples Classes (extension) | Red > redUniverse'>redUniverse RedQWindow Extensi ...