Skip to content
View bounce.rb
# bounce.rb
class Bounce < Processing::App
BLUE = '#0000FF'
GREEN = '#00FF00'
RED = '#FF0000'
WHITE = '#FFFFFF'
BALL_SPEED = 5
BALL_SIZE = 32
View extensions.xml
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-ruby</artifactId>
<version>0.1.11</version>
</extension>
</extensions>
View steinberg.glsl
// Original shader by RavenWorks
// Fake Floyd-Steinberg dithering
// https://www.shadertoy.com/view/4sjGRD
// Adapted for Ruby-Processing by Martin Prout <@monkstoneT>
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
View custom_array.rb
require 'forwardable'
# A custom Array created using forwardable (that can also access the PApplet pre,
# post and draw loops by extending our new LibraryProxy class. Also has access
# to custom background(int), fill(int) and stroke(int) methods.
class CustomArray < LibraryProxy
extend Forwardable
def_delegators(:@objs, :each, :<<)
include Enumerable
View convert.rb
# convert.rb
def titleize(str)
str.gsub(/::/, '/')
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
.tr('-', '_')
.downcase
.gsub(/_id$/, '')
.gsub(/_/, ' ').capitalize
View test.rb
require 'java'
java_import java.lang.System
jars = Dir[File.join('/home/tux/ruby-processing/lib', '**/*.jar')]
System.setProperty('java.class.path', jars.join(':'))
p System.getProperties['java.class.path']
libpath = System.getProperties['java.library.path']
libpath
System.setProperty('java.library.path', ['/home/tux/lib/linux64', libpath].join(':'))
View box_fluid_demo.rb
require 'toxiclibs'
#
# <p>BoxFLuid demo combining 3D physics particles with the IsoSurface class to
# create an animated mesh with a fluid behaviour. The mesh is optionally created
# within a boundary sphere, but other forms can be created using a custom
# ParticleConstraint class.</p>
#
# <p>Dependencies:</p>
# <ul>
View .nbattrs
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd">
<attributes version="1.0">
<fileobject name="Sketch.rb">
<attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
<attr name="template" boolvalue="true"/>
</fileobject>
<fileobject name="SketchGL.rb">
<attr name="displayName" stringvalue="SketchGL.rb"/>
<attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
View .rp5rc
{
"JRUBY": "false",
"PROCESSING_ROOT": "/home/tux/processing-3.0a5",
"X_OFF": 192,
"Y_OFF": 108
}
View app.rb
# version without embedded or online
# This class is a thin wrapper around Processing's PApplet.
# Most of the code here is for interfacing with Swing,
# web applets, going fullscreen and so on.
require 'java'
require_relative '../ruby-processing/helper_methods'
require_relative '../ruby-processing/helpers/string'
require_relative '../ruby-processing/library_loader'
require_relative '../ruby-processing/config'
Something went wrong with that request. Please try again.