OpenGL Wrapper Bindings

Hi all,

I’ve been getting some visualisation working using the ruby-opengl
OpenGL/GLUT wrapper.

One thing that is hampering my progress is not having a mapping from the
Ruby commands to the GLUT/GL commands, for example:

This code: “GL.Normal(x, y, z)”
Translates to this GL/GLUT call: “glNormal3f(x, y, z)”

I’m having difficulty finding a list, or rule, for these mappings. This
means I’m finding it difficult to take some plain C GLUT call, and make
the same call using the Ruby wrapper, or vice-versa.

For example, “GL.ShadeModel(GL::FLAT)” is a line from a Ruby Opengl
example, how do I translate this to a native GLUT call to look up the
documentation?

Or, another example, the GLUT call “glutSolidTetrahedron()”, what is the
equivalent call for the Ruby wrapper?

Any help much appreciated, thanks for taking the time to read!

  • Nex

On Fri, Jul 27, 2007 at 10:52:24PM +0900, Peter L. wrote:

Hi all,

I’ve been getting some visualisation working using the ruby-opengl
OpenGL/GLUT wrapper.

One thing that is hampering my progress is not having a mapping from the
Ruby commands to the GLUT/GL commands, for example:

This code: “GL.Normal(x, y, z)”
Translates to this GL/GLUT call: “glNormal3f(x, y, z)”
[…]
Any help much appreciated, thanks for taking the time to read!

You must be using an old version. The current version provides
GL.glNormal3f rather than GL.Normal, and so on. An easy way to find a
method is to run irb (with appropriate -r flags to require the right
files)
and something like GL.public_methods.grep /shademodel/i

  • Nex
    –Greg

Thanks for your help, I’ll try installing again as my version doesn’t
understand standard type calls like “GL.glNormal3f”.

  • Nex