Rendering ruby openGL output to a file.

Discussion in 'Ruby' started by Brian Schröder, Feb 28, 2005.

  1. Hello Group,

    I don't know if this is off topic, but at least a ruby program is
    involved. I have written a small ruby script that renders some things
    using the opengl ruby library. Now I want to include the images into
    my thesis, and I'd like to use a higher resolution that what my screen
    can give. Is it possible to render the image not onto the screen, but
    into a file, using a bigger-than-screen resolution? I'm quite an
    opengl newbie so maybe this is obious?

    regards,

    Brian
     
    Brian Schröder, Feb 28, 2005
    #1
    1. Advertisements

  2. I resolved this issue by switching to povray. Now I simply create a
    povray description of the scene, and render this in better quality.

    One should not always use the hammer ;)

    Regards,

    Brian
     
    Brian Schröder, Feb 28, 2005
    #2
    1. Advertisements

  3. Brian Schröder

    Denis Mertz Guest

    You can do that with the Mesa off-screen rendering library (OSMesa)

    http://www.mesa3d.org/osmesa.html

    Ciao

    dm1
     
    Denis Mertz, Feb 28, 2005
    #3
  4. Brian Schröder

    Eric Peden Guest

    You might get some use out of RMagick, a Ruby interface for
    ImageMagick/GraphicsMagick:

    http://rmagick.rubyforge.org/

    The OpenGL API works with raw color values packed into an array;
    RMagick (as far as I can tell) cannot. You should be able to draw your
    scene offscreen, then do a readPixels() and then convert the resulting
    array to RMagick Pixel values. Tell RMagick what your intended
    resolution is, and it will handle the rest.
     
    Eric Peden, Feb 28, 2005
    #4
  5. Brian Schröder

    Tim Hunter Guest

    The #constitute method takes an array of RGBA values as input:
    http://www.simplesystems.org/RMagick/doc/image1.html#constitute
     
    Tim Hunter, Feb 28, 2005
    #5
  6. Brian Schröder

    Joe Van Dyk Guest

    I did something like this, except with C and ImageMagick. It was
    actually easier for me (for some reason) to process the arrays in C
    rather than in Ruby back then.
     
    Joe Van Dyk, Feb 28, 2005
    #6
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.