Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old July 18th, 2005, 07:41 PM
Zunbeltz Izaola
Guest
 
Posts: n/a
Default save an opengl canvas (wxPython)


Hi,

I've a drawing made in an OpenGL canvas. I want to save it to a file
(preferibly PostScript format). Somebody knows how to do it?

TIA

Zunbeltz

--
Zunbeltz Izaola Azkona | wmbizazz at lg dot ehu
dotes
Materia Kondentsatuaren Fisika Saila |
Zientzia eta Teknologia Fakultatea | Phone: 34946015326
Euskal Herriko Unibertsitatea |
PK 644 | Fax: 34 944648500
48080 Bilbo (SPAIN) |



  #2  
Old July 18th, 2005, 07:46 PM
Mike C. Fletcher
Guest
 
Posts: n/a
Default Re: save an opengl canvas (wxPython)

There's sample code in PyOpenGL and OpenGLContext for saving canvases to
PNG or JPEG formats using PIL. Saving to Postscript requires
considerably more work (if you're implying saving as triangles, lines
and the like). There is a GPL library which lets you do this, and I
have an old SWIG wrapper for it sitting around somewhere (I think,
haven't touched it in years), but even then, it's fairly poor quality
compared to capturing a bitmap image.

Anyway, the function for reading a buffer is glReadPixels:
http://pyopengl.sourceforge.net/docu...dPixels.3G.xml
see the end of that man page for pointers to Python sample code.

Good luck,
Mike

Zunbeltz Izaola wrote:
[color=blue]
>Hi,
>
>I've a drawing made in an OpenGL canvas. I want to save it to a file
>(preferibly PostScript format). Somebody knows how to do it?
>
>TIA
>
>Zunbeltz
>
>[/color]
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com

  #3  
Old July 18th, 2005, 07:47 PM
Zunbeltz Izaola
Guest
 
Posts: n/a
Default Re: save an opengl canvas (wxPython)

"Mike C. Fletcher" <mcfletch@rogers.com> writes:
[color=blue]
> There's sample code in PyOpenGL and OpenGLContext for saving canvases
> to PNG or JPEG formats using PIL. Saving to Postscript requires
> considerably more work (if you're implying saving as triangles, lines
> and the like). There is a GPL library which lets you do this, and I
> have an old SWIG wrapper for it sitting around somewhere (I think,
> haven't touched it in years), but even then, it's fairly poor quality
> compared to capturing a bitmap image.
>
> Anyway, the function for reading a buffer is glReadPixels:
> http://pyopengl.sourceforge.net/docu...dPixels.3G.xml
> see the end of that man page for pointers to Python sample code.
>
> Good luck,
> Mike
>[/color]

Hi Mike,

Thanks for the answer. I'll check the code. For the moment png or jpeg
is ok, but maybe in the future i'll like to save the image as
postscript to use it with LaTeX font and so on. I've se the gl2ps
library and the last version is 21 September 2004. Can you send me
the SWIG file? I don't know much about swig and it would be easier
to start with a file that has work in same older version.

Thanks again

Zunbeltz



--
Zunbeltz Izaola Azkona | wmbizazz at lg dot ehu
dotes
Materia Kondentsatuaren Fisika Saila |
Zientzia eta Teknologia Fakultatea | Phone: 34946015326
Euskal Herriko Unibertsitatea |
PK 644 | Fax: 34 944648500
48080 Bilbo (SPAIN) |
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.