Up: gltools - an OpenGL based on-line graphics toolbox
Next:
Prev: glmesh - Function Drawing on Simplex Meshes


Subsections


gleps - Encapsulated Postscript Dump

Revision: 2.10
Date: 2003/03/28 16:47:46
Author: Jürgen Fuhrmann


This module provides the possibility to dump rendered graphics into vector postscript files using the feedback buffer rendering mechanism of OpenGL. It is in a beta state and possibly will remain there because it is not that easy to map correctly all the OpenGL functionality to Postscript. It should reasonably well render graphics which remains in the limits of the OpenGL features used by the other gltools parts.

This code would not exist if Mark Kilgard wouldn't have placed his rendereps sample code onto the net, and if there would not exist Frederic Delhoume's free gouraudtriangle postscript code. From Mark's code, handling of lines and polygons has been taken. String handling is new.

I tried to keep the generated postscript files as human readable as possible. Especially, there is a "tuning section" in the prolog where the user can change fonts, font sizes etc.

The main problems with the output are caused by the fact that OpenGL does not know alignment of bitmaps (bitmaps are used by glxUseXFont), and that there seems to be no simple possibility to align strings in OpenGL output. So only bottom left alignment of strings is possible, this is not quite beautiful. This problem also leads to the fact that Bounding box calculation in presence of strings may be incorrect.

Until now, I only see the possibility to tune the eps files by hand. In the ps header there are defined some alingned show commands which can be used to improve label placement in the ps file. Any idea to cope with this situation is appreciated.

glepsDumpUnSorted

void glepsDumpUnSorted(glWindow w, FILE *file,int crop);

Create vector postscript dump using the feedback buffer mechanism, but without hidden surface removal. The crop flag is used to decide whether to crop ps output to the actually drawn area or not.

glepsDumpSorted

void glepsDumpSorted(glWindow w, FILE *file, int crop);

Create vector postscript dump using the feedback buffer mechanism, with hidden surface removal based on sorting the feedback buffer before the dump. The crop flag is used to decide whether to crop ps output to the actually drawn area or not.

glepsSetOutputFormat

void glepsSetOutputFormat(char * coord_fmt, char *color_fmt);

Set the output format for floating point numbers (different for coordinates and colors) in the postscript file. (The more accurate the format, the longer the file...). There have to be a trailing spaces both formats.

void glepsEmitHeader(glWindow w, FILE *file);
void glepsEmitTrailer(glWindow w, FILE *file, int npages);
void glepsGrabEPSFrame(glWindow w, FILE *file, int npage);

Up: gltools - an OpenGL based on-line graphics toolbox
Next:
Prev: glmesh - Function Drawing on Simplex Meshes


© pdelib team 4/17/2003. This page has been generated using the LaTeX typesetting system and latex2html.