Skip to content

Instantly share code, notes, and snippets.

@tuzz
Created March 15, 2012 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuzz/2047461 to your computer and use it in GitHub Desktop.
Save tuzz/2047461 to your computer and use it in GitHub Desktop.
A simple demo of my scene gem
# gem install scene
require 'rubygems'
require 'scene'
class MyScene < Scene
def display
@count ||= 0
@count += 1
@count %= 200
@colours = 30.times.map { [rand, rand, rand] } if @count == 1
glBegin(GL_TRIANGLE_FAN)
@colours.each do |colour|
glColor3f(*colour)
vertex = colour.map { |c| 2 * c - 1 }
glVertex3f(*vertex)
end
glEnd
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment