Skip to content
Simple example of ruby visual simulation with opengl
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
lib
linkage
Gemfile
bezier.md
bezier.rb
readme.md
simulation1.rb
simulation2.rb
simulation3.rb
simulation4.rb
simulation5.rb

readme.md

Hello

OpenGL Ruby

Install

To start working with OpenGL in Ruby you have to install some system packages first

sudo apt-get install mesa-utils mesa-common-dev freeglut3-dev

And install the following gems glu/glut/opengl

bundle install

Bezier

Simple Bezier curve example

Usage example

renderer = Render.new
renderer.scene = { objects: objects,
                   types: { TailedObject => { point: ->(o) { o.position }, path: ->(o) { o.path } } } }

physics = Physics.new
renderer.run do
  physics.step renderer.scene[:objects], Time.now.to_f
end
You can’t perform that action at this time.