[vtkusers] RE:How to improve the quality of rendered lines?

Kaptein, B.L. (ORTHO) B.L.Kaptein at lumc.nl
Wed May 23 12:16:46 EDT 2001


To get nice PostScript prints from vtk,
I added the GL2PS library of Christophe Geuzaine http://www.geuz.org/gl2ps/
to my vtk programm. This is an OpenGL to Postscript translator written in C.

The current 0.31 version has some memory leaks, but they will be solved in
the next version. (I found the leaks and contacted Christophe).

To use this library in my vtk application (based on the MFC_sample) I added
the following code to the SampleView class:

	FILE *fp;
	fp = fopen(FileDialog.GetFileName(), "w");
	int buffsize = 0;
	int state;
	state = GL2PS_OVERFLOW; while( state == GL2PS_OVERFLOW )
		buffsize += 1024*1024;
		gl2psBeginPage ( "Model Based RSA", "MBRSA", GL2PS_BSP_SORT,
             GL_RGBA, 0, NULL, buffsize, fp );
		state = gl2psEndPage();

Note that to produce a PostScript dump of your RenderWindow, you only have
to place a gl2psBeginPage before and an gl2psEndPage after the
RenderWindow->Render() command.

The postscript files are good.

I hope this helps???

Bart Kaptein (bart at dsdelft.nl)

> >>>>> "Lisa" == Lisa S Avila <lisa.avila at kitware.com> writes:
>     Lisa> Hello Pearu, You can try two things - create a larger image
>     Lisa> (vtkRenderLargeImage), and use antialiasing (SetAAFrames to
>     Lisa> something like 16 on the vtkRenderWindow).  This will
>     Lisa> improve your image quality.
> Setting AA frames works well but there are two problems 
> 	(1) Text actors with shadow seem to come out badly.
> 	(2) It takes a lot of time to render, but the AA lines seem
> 	worth it. :)
> The DPI setting seems to have no effect. Or am I missing something.
> prabhu

More information about the vtkusers mailing list