Skip to content
<?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>
// 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
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
# 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
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(':'))
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>
<?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"/>
{
"JRUBY": "false",
"PROCESSING_ROOT": "/home/tux/processing-3.0a5",
"X_OFF": 192,
"Y_OFF": 108
}
# 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'
grey_circles.rb:10 warning: ambiguous Java methods found, using background(int)
Exception in thread "Animation Thread" org.jruby.exceptions.RaiseException: (IOError) closed stream
at java.lang.Thread.getStackTrace(java/lang/Thread.java:1552)
at org.jruby.runtime.backtrace.TraceType$Gather.getBacktraceData(org/jruby/runtime/backtrace/TraceType.java:175)
at org.jruby.runtime.backtrace.TraceType.getBacktrace(org/jruby/runtime/backtrace/TraceType.java:39)
at org.jruby.RubyException.prepareBacktrace(org/jruby/RubyException.java:227)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:215)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:194)
at org.jruby.exceptions.RaiseException.<init>(org/jruby/exceptions/RaiseException.java:110)
at org.jruby.Ruby.newRaiseException(org/jruby/Ruby.java:3959)
Something went wrong with that request. Please try again.