Forum: Ruby openGL documention?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A4f708e0f3856e92b7ee83d1c4ee5c0e?d=identicon&s=25 Bas Wilbers (basaah)
on 2006-03-31 14:43
hello,
lately is was experimenting a bit with ruby-opengl,
It works a little bit and I found a few things already,
but It would go much faster with documentation the examples only is not
enough plus not evrything is there problably.
I did found a very good guide on GLprogramming.com but it was for normal
opengl not the ruby one, most of the things said there are usefull, but
there are also a lot of things I cannot get to work as they say it
should with ruby-opengl.
does somebody now if there is anything like documentation of rubyopengl
or a reference or something or better #commented examples.

thanks in advance
bas wilbers
E29eaefee1709918198c8a4f55c42667?d=identicon&s=25 anne001 (Guest)
on 2006-03-31 23:01
(Received via mailing list)
In my experience the ruby openGl have been just like their "normal"
counterpart.
what did you have trouble with?
40b8ef8518829533bc6969596e211275?d=identicon&s=25 unknown (Guest)
on 2006-03-31 23:19
(Received via mailing list)
Just for some background, here on Debian Etch I can apt-get install
libopengl-ruby (the package which supplies ruby-opengl:
http://www2.giganet.net/~yoshi/ ). To install it, it pulls in freeglut3
also. It gives you opengl.so and glut.so. The readme does not seem to
be available in english.

I notice that, for writing games with Ruby, RubyGame (
http://rubygame.seul.org/ ) makes use of ruby-opengl as well. It's docs
have this to say:

| Please note that Rubygame itself does not provide an interface
| to OpenGL functions - only functions which allow Rubygame to
| work together with OpenGL. You will need to use another library,
| for example ruby-opengl, to actually create graphics with OpenGL.

There's a bit more to say on Ruby + OpenGL at the wiki:
http://www.rubygarden.org/ruby?OpenGL

Would someone mind posting a translation of the README.EUC here?
Thanks,
---John
28d78f0eb6df0191896f8696741b63d5?d=identicon&s=25 Gary Watson (pfharlock)
on 2006-04-01 06:18
bas wilbers wrote:
> hello,
> lately is was experimenting a bit with ruby-opengl,
> It works a little bit and I found a few things already,
> but It would go much faster with documentation the examples only is not
> enough plus not evrything is there problably.
> I did found a very good guide on GLprogramming.com but it was for normal
> opengl not the ruby one, most of the things said there are usefull, but
> there are also a lot of things I cannot get to work as they say it
> should with ruby-opengl.
> does somebody now if there is anything like documentation of rubyopengl
> or a reference or something or better #commented examples.
>
> thanks in advance
> bas wilbers


checkout this site http://nehe.gamedev.net/

it has tutorials for opengl, the neat thing is that the tutorials are
duplicated for almost every language imaginable.  There are ruby
examples on that web site.

Hope this helps
   Gary
E20e89d58211a3631842daecc1245de2?d=identicon&s=25 Ilmari Heikkinen (Guest)
on 2006-04-01 06:31
(Received via mailing list)
On 4/1/06, john_sips_tea@yahoo.com <john_sips_tea@yahoo.com> wrote:
> Just for some background, here on Debian Etch I can apt-get install
> libopengl-ruby (the package which supplies ruby-opengl:
> http://www2.giganet.net/~yoshi/ ). To install it, it pulls in freeglut3
> also. It gives you opengl.so and glut.so. The readme does not seem to
> be available in english.

> Would someone mind posting a translation of the README.EUC here?
> Thanks,
> ---John

It's out of date, but here goes, with the help of wwwjdic:


opengl extension module

This module is for using OpenGL+glut from ruby.
Due to the implementation still being incomplete,
use it with the awareness that there is a great
number of bugs and functions that can't be used.

This module has been tested with ruby-1.4.3 on
irix6.5+glut3.7.

External dependencies: OpenGL(Mesa)+glut.

Installing

copy opengl.0.3.tgz into ruby's directory and
execute the following commands:

        gzip -dc opengl.0.3.tgz | tar xvf -
        cd ruby-gl
        ruby extconf.rb
        make

Usage

For using GL, GLU:
  require "opengl"
For using GLUT:
  require "glut"

For more details, consult the source files
in the sample directory.

Note: if a sample app crashes with an X error,
comment out the line with have_library("pthread","pthread_create")
in extconf.rb, recompile the module, and try again.

Send bug reports, opinions about the module, etc.
to one of the following, please:
 [contact infos]

Most of the work was done by yashi. Muchos gracias (???)
40b8ef8518829533bc6969596e211275?d=identicon&s=25 unknown (Guest)
on 2006-04-01 07:59
(Received via mailing list)
Ilmari Heikkinen wrote:
> [snip]
>
> Most of the work was done by yashi. Muchos gracias (???)

Thanks!
A4f708e0f3856e92b7ee83d1c4ee5c0e?d=identicon&s=25 Bas Wilbers (basaah)
on 2006-04-01 11:33
Gary Watson wrote:
> bas wilbers wrote:
>> hello,
>> lately is was experimenting a bit with ruby-opengl,
>> It works a little bit and I found a few things already,
>> but It would go much faster with documentation the examples only is not
>> enough plus not evrything is there problably.
>> I did found a very good guide on GLprogramming.com but it was for normal
>> opengl not the ruby one, most of the things said there are usefull, but
>> there are also a lot of things I cannot get to work as they say it
>> should with ruby-opengl.
>> does somebody now if there is anything like documentation of rubyopengl
>> or a reference or something or better #commented examples.
>>
>> thanks in advance
>> bas wilbers
>
>
> checkout this site http://nehe.gamedev.net/
>
> it has tutorials for opengl, the neat thing is that the tutorials are
> duplicated for almost every language imaginable.  There are ruby
> examples on that web site.
thank you for this site it looks good, but there are no ruby examples
there, only on one tutorial and that link is broken, I googled the site
for ruby and again only that broken link was found.
>
> Hope this helps
but they do help cuase there is a lot of information on the site but
still not really what I was looking for.
thanks for your post

>    Gary
E29eaefee1709918198c8a4f55c42667?d=identicon&s=25 anne001 (Guest)
on 2006-04-01 12:26
(Received via mailing list)
what are you looking for. Can you give a specific example?
A4f708e0f3856e92b7ee83d1c4ee5c0e?d=identicon&s=25 Bas wilbers (Guest)
on 2006-04-02 22:16
anne001 wrote:
> what are you looking for. Can you give a specific example?

well the camera stuff, and how can I make that a cube gets smaller when
it's further away. also the texture part is weird I know how it works
but when I rotate the object it does weird stuff.

mostly the camera part is what I was looking for.
E29eaefee1709918198c8a4f55c42667?d=identicon&s=25 anne001 (Guest)
on 2006-04-02 23:15
(Received via mailing list)
E20e89d58211a3631842daecc1245de2?d=identicon&s=25 Ilmari Heikkinen (Guest)
on 2006-04-03 04:52
(Received via mailing list)
Hi,

On 4/2/06, Bas wilbers <baswilbers@gmail.com> wrote:
> anne001 wrote:
> > what are you looking for. Can you give a specific example?
>
> well the camera stuff, and how can I make that a cube gets smaller when
> it's further away. also the texture part is weird I know how it works
> but when I rotate the object it does weird stuff.
>
> mostly the camera part is what I was looking for.

here's the rendering loop for a scene with a
perspective projection camera and double buffering:

include GL
loop do
  MatrixMode(PROJECTION)
  LoadIdentity()
  Perspective(
    camera.fov,
    viewport.width.to_f / viewport.height,
    camera.near_clip,
    camera.far_clip)
  MatrixMode(MODELVIEW)
  LoadIdentity()
  LookAt(
    camera.position,
    camera.looking_at,
    camera.up_vector)

  call_frame_handlers_to_update_scene_and_camera

  draw scene

  swap_buffers
end

HTH,
Ilmari
A4f708e0f3856e92b7ee83d1c4ee5c0e?d=identicon&s=25 baswilbers (Guest)
on 2006-04-04 17:38
> include GL
thank you for your example
> loop do
>   MatrixMode(PROJECTION)
>   LoadIdentity()
>   Perspective(
>     camera.fov,
>     viewport.width.to_f / viewport.height,
>     camera.near_clip,
>     camera.far_clip)
error =  undefined local variable or
method `camera' for main:Object (NameError)

do I have to make the camera or something, I'm sorry but I want to get
it working. but it wont
>   MatrixMode(MODELVIEW)
>   LoadIdentity()
>   LookAt(
>     camera.position,
>     camera.looking_at,
>     camera.up_vector)
>
>   call_frame_handlers_to_update_scene_and_camera
>
>   draw scene
>
>   swap_buffers
> end
>
E29eaefee1709918198c8a4f55c42667?d=identicon&s=25 anne001 (Guest)
on 2006-04-04 18:37
(Received via mailing list)
this example uses lookAT
http://www.lighthouse3d.com/opengl/glut/index.php?6

looks like camera is a structure you will have to define/initialize.
A4f708e0f3856e92b7ee83d1c4ee5c0e?d=identicon&s=25 baswilbers (Guest)
on 2006-04-06 14:34
anne001 wrote:
> this example uses lookAT
> http://www.lighthouse3d.com/opengl/glut/index.php?6
that's what I mean these are C# code and not ruby, I think there are not
much ruby opengl examples. but there are a lot for C so I think I'm just
gonna learn C.
I believed you can also write libraries/plugins for ruby in C so C will
be cool to improve ruby.

>
> looks like camera is a structure you will have to define/initialize.
yes but how?

Thank you all for your examples and links. although these are C sites
they are very usefull cause I'm gonna learn C.

bas
This topic is locked and can not be replied to.