[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rendering ruby openGL output to a file.

Brian Schröder

2/28/2005 11:27:00 AM

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
http://ruby.brian-sch...



5 Answers

Brian Schröder

2/28/2005 12:14:00 PM

0

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


On Mon, 28 Feb 2005 12:26:35 +0100, Brian Schröder <ruby.brian@gmail.com> wrote:
> 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
> http://ruby.brian-sch...
>


--
--
Brian Schröder
http://ruby.brian-sch...



Denis Mertz

2/28/2005 3:43:00 PM

0

On Mon, 28 Feb 2005 20:26:52 +0900, Brian Schröder wrote:

> 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

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

http://www.mesa3d.org/o...

Ciao

dm1

Eric Peden

2/28/2005 4:03:00 PM

0

On Feb 28, 2005, at 5:26 AM, Brian Schröder wrote:
> ow 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?

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

http://rmagick.ruby...

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




Tim Hunter

2/28/2005 4:30:00 PM

0

Eric Peden wrote:
> On Feb 28, 2005, at 5:26 AM, Brian Schröder wrote:
>
>> ow 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?
>
>
> You might get some use out of RMagick, a Ruby interface for
> ImageMagick/GraphicsMagick:
>
> http://rmagick.ruby...
>
> 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.
>
The #constitute method takes an array of RGBA values as input:
http://www.simplesystems.org/RMagick/doc/image1.html#...

Joe Van Dyk

2/28/2005 6:55:00 PM

0

On Tue, 1 Mar 2005 01:02:43 +0900, Eric Peden <eric@ericpeden.com> wrote:
> On Feb 28, 2005, at 5:26 AM, Brian Schröder wrote:
> > ow 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?
>
> You might get some use out of RMagick, a Ruby interface for
> ImageMagick/GraphicsMagick:
>
> http://rmagick.ruby...
>
> 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.
>

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.