ruby and 2D graphics

P

Philip Müller

Hi everybody,

I'm searching for a way to get simple graphical output in ruby for a
simple physics simulation. All I need are circles and lines and a decent
framerate in fullscreen-like resolutions. I tried ruby-processing but in
800*600 i get less than 10 frames on my not-too-old pc. And that's just a
circle moving around, no physics whatsoever involved.

Thanks for your input

Philip
 
R

Rolando Abarca

I would recomend you gosu:

http://www.libgosu.org/

Hi everybody,

I'm searching for a way to get simple graphical output in ruby for a =20=
simple physics simulation. All I need are circles and lines and a =20
decent framerate in fullscreen-like resolutions. I tried ruby-=20
processing but in 800*600 i get less than 10 frames on my not-too-=20
old pc. And that's just a circle moving around, no physics =20
whatsoever involved.

Thanks for your input

Philip


regards,
--=20
Rolando Abarca M.
 
P

Peter Zotov

Quoting "Philip M=C3=BCller said:
I'm searching for a way to get simple graphical output in ruby for a =20
simple physics simulation. All I need are circles and lines and a =20
decent framerate in fullscreen-like resolutions. I tried =20
ruby-processing but in 800*600 i get less than 10 frames on my =20
not-too-old pc. And that's just a circle moving around, no physics =20
whatsoever involved.

I used Ruby/OpenGL in my physics simulator. It gave me 60 fps on ~20 =20
objects w/out physics or 30 with it. Fast enough for me. I have NVidia =20
Geforce FX 5200 and Athlon 64 3000+.
 
J

Joel VanderWerf

Philip said:
Hi everybody,

I'm searching for a way to get simple graphical output in ruby for a
simple physics simulation. All I need are circles and lines and a decent
framerate in fullscreen-like resolutions. I tried ruby-processing but in
800*600 i get less than 10 frames on my not-too-old pc. And that's just
a circle moving around, no physics whatsoever involved.

Thanks for your input

Philip

I mentioned tkar, my own tool for this purpose, on the list a few weeks ago:

http://groups.google.com/group/ruby-talk-google/browse_thread/thread/268d3a322473d7ba

It's written in ruby, but you can pipe it data from anything, and it
even embeds as a simulink block.

It's based on the tk canvas, which is really pretty good for simple
purposes, and easy to make interactive.
 
P

Peter Zotov

Quoting "Philip M=C3=BCller said:
Interesting. What do I need to use OpenGL in ruby and where can I =20
get documentation for that?

They have a site, http://ruby-opengl.rubyforge.org/. There are also a =20
nice tutorial, but I found examples that were shipped with gem =20
(ruby-opengl) more informative. Or you can browse them at SVN =20
(http://ruby-opengl.rubyforge.org/svn/trunk/examples/). Unfortunately, =20
I cannot give you sources of my simulator, they probably were lost.
 
S

Shawn Anderson

Rubygame and Gosu are great options. I use Rubygame; I have started a
framework on top of it to make simple game objects with physics attached
easy to setup and run.

It's still very much alpha, but may suit your needs:
http://shawn42.github.com/gamebox/

A sample Asteroids clone w/ physics is available here:

http://is.gd/oLTI

If it looks to meet your needs, I can walk you through setting up
Rubygame/Gamebox for yourself (as the documentation is incomplete at the
moment).

/Shawn
 
P

Philip Müller

I would recomend you gosu:

http://www.libgosu.org/

ok, maybe this is getting off-topic now, but when I

sudo gem install gosu

i get

Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

I have no idea where to search for this mkmf.log file and I have no idea
why it fails in the first place.

If this is off-topic here please direct me somewhere where it fits.

thanks
Philip
 
A

Adam Gardner

Philip said:
ok, maybe this is getting off-topic now, but when I

sudo gem install gosu

i get

Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

I have no idea where to search for this mkmf.log file and I have no idea
why it fails in the first place.

If this is off-topic here please direct me somewhere where it fits.

thanks
Philip

That's... pretty weird. That never happens to me when I'm using gosu.
I'd ask you what platform you're using, but perhaps a better idea would
be for me to direct your questions to the official Gosu forums:
http://www.libgosu.org/cgi-bin/mwf/forum_show.pl
 
J

Jimmy Kofler

Philip said:
Hi everybody,

I'm searching for a way to get simple graphical output in ruby for a
simple physics simulation. All I need are circles and lines and a decent
framerate in fullscreen-like resolutions. I tried ruby-processing but in
800*600 i get less than 10 frames on my not-too-old pc. And that's just
a
circle moving around, no physics whatsoever involved.

Thanks for your input

Philip

Two more options:

1.

Chipmunk

2D video games engine; 2D graphics library

http://wiki.slembcke.net/main/published/Chipmunk

http://code.google.com/p/gosu/wiki/RubyChipmunkIntegration


2.

GLFW

a free, Open Source, portable framework for OpenGL application
development

http://ruby-glfw.rubyforge.org

Cheers,

j.k.
 
T

Tom Reilly

Can anyone tell me how to correct the following error?

RUBY PROGRAM:
---------------------

require 'sqlite3'
p "open db"
db = SQLite3::Database.new( "data.db" )
p "db close"
db.close

-------------------
ERROR:
ruby dbtest.rb
/sqlite3.dll: 127: The specified procedure could not be found. -
Init_sqlite3 (LoadError)
/sqlite3.dll from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from dbtest.rb:2
Exit code: 1

-------------------
SYSTEM CONFIGURATION

Windows Vista
sqlite3.dll is in the same directory as the program - windows version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
gem sqlite3-ruby-1.2.0-mswin32

I'd appreciate any information available.
Thanks
Tom Reilly
 
H

Heesob Park

2009/3/25 Tom Reilly said:
Can anyone tell me how to correct the following error?

RUBY PROGRAM:
---------------------

require 'sqlite3'
p "open db"
db =3D SQLite3::Database.new( "data.db" )
p "db close"
db.close

-------------------
ERROR:
ruby dbtest.rb
./sqlite3.dll: 127: The specified procedure could not be found. =C2=A0 -
Init_sqlite3 (LoadError)
./sqlite3.dll =C2=A0 =C2=A0from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
=C2=A0 from dbtest.rb:2
Exit code: 1

-------------------
SYSTEM CONFIGURATION

Windows Vista
sqlite3.dll is in the same directory as the program - windows version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
gem sqlite3-ruby-1.2.0-mswin32
Move sqlite3.dll to somewhere in your PATH.

Refer to http://groups.google.com/group/comp.lang.ruby/browse_thread/thread=
/9d5c9ee6167dace4

Regards,

Park Heesob
 
J

James Gray

2009/3/25 Tom Reilly said:
Can anyone tell me how to correct the following error?

RUBY PROGRAM:
---------------------

require 'sqlite3'
p "open db"
db = SQLite3::Database.new( "data.db" )
p "db close"
db.close

-------------------
ERROR:
ruby dbtest.rb
./sqlite3.dll: 127: The specified procedure could not be found. -
Init_sqlite3 (LoadError)
./sqlite3.dll from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from dbtest.rb:2
Exit code: 1

-------------------
SYSTEM CONFIGURATION

Windows Vista
sqlite3.dll is in the same directory as the program - windows version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
gem sqlite3-ruby-1.2.0-mswin32
Move sqlite3.dll to somewhere in your PATH.

Refer to http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/9d5c9ee6167dace4

Or switch to Amalgalite so you don't have to worry about issues like
this. :)

James Edward Gray II
 
E

ext-golla.anil-kumar

=20
Hi,
Can anybody give some examples or link for debugging a ruby script.

Thanks,
Anil kumar
 
R

Rick DeNatale

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,501
Latest member
log5Sshell/alfa5

Latest Threads

Top