From: anne001 Date: 2006-07-07T20:34:53+09:00 Subject: Re: ruby-opengl 1. Did you look at Yoshi's install? I was not able to install 0.32g on tiger with the 1.8.4 ruby. I was able to install it with 1.8.2 ruby, moving the bundles to a directory 1.8.4 could see. Unless people can install... 2. I can see why you would want to do away with GL and GLUT in front of the function, less typing, but for a beginner, they were very useful. I should still be able to put them in front, no? a) I found the GL and GLUT in front of the opengl function very helpful just to remember what library the function came from b) Swapping GL for a new class, I was able to redirect the output which I found very useful: as an opengl beginner, I found it difficult to figure out what the opengl code was that I was outputing, given that I had recursive calls through trees... (for the limb of a person for example) replacing GL by a new class constant gave me a wonderful tool to redirect the code to a text file without changing any of the code. RealGL = GL class LoggingGL class << self def method_missing(meth, *args) puts "#{meth}(#{args.join(', ')})" RealGL.send(meth, *args) end def const_missing(const) RealGL.const_get(const) end end end GL = LoggingGL http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/84888e5307628bf3/a1d1508397bff92c?q=realGL&rnum=1#a1d1508397bff92c 3) "Your Ruby GL code should look a whole lot like your C code" I don't agree with that idea at all. I spent a lot of time working on robot.rb so it would take advantage of the OOP aspect of ruby, and as a consequence, my ruby openGL does not look much like the C code I think. If I am going to code in ruby the way I would in C I don't really see the point in using Ruby. In ruby, I am trying to code the ruby way. 4) Thank you for giving an example of the use of lambda. It took me a while to figure out how to use that feature - with help from this list -- as Yoshi's examples are straight C translation which use a fx. reshape = lambda do |w, h| glViewport( ... ) glMatrixMode( GL_PROJECTION ) # etc. glMatrixMode( GL_MODELVIEW ) glLoadIdentity end glutReshapeFunc( reshape ) 5) I would be happy to pass you a copy of the robot.rb version I worked on. I would love for someone who knows ruby to improve on it so people have a real ruby way opengl example, instead of souped up C opengl example to start with.