gameblender vector output ( GL2PS )

Hi there,

from time to time I need 2D vector output from a 3D modell, so I can easily use it for postprocessing and compositing in programmes like Illustrator or Inkscape.

Basically what I need is a clean vector rendering, which I can take apart, edit and recompose in some way. Vector format is also helpful because it is easily scaleable.

Here are two examples for possible uses:
http://www.realu.de/projects/spots/pics/drawings/051208-perspektive-A4-300.jpg
http://www.realu.de/download/MuseumX/img/060217_MuseumX.jpg

There is a library called GL2PS (http://www.geuz.org/gl2ps/), which can capture openGL commands into PS or PDF files.

Essentially it works by wrapping gl2psBeginPage and gl2psEndPage around the normal openGL rendering.

My idea is now that I could do the modelling in Blender, start the game engine, move the camera around, press a key and get a Postscript file.

Do you think it would be possible to integrate this as an option into Gameblender?

I had a look at the source and believe that a possible integration should go somewhere here: blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer ,
but I certainly could not do It myself, since I don’t understand enough of blender source/ opengl/ c programming.

Maybe vector capturing could be enabled and disabled from python with something like GameLogic.Rasterizer.enableCapture(filename=’…’, …)?

Does anybody know if this makes any sense?

All the best,
Stefan

interesting.
in the unlikely case I got extra spare time, I might want to check this out.

Otherwise, perhaps Charlie/snailrose, Lagan or Dreamkatana has time?

Erwin

Hi Erwin and everybody else,

today i made some quick hacks and compiled gl2ps into blender.
To my great surprise it actually worked.

I can render shaded SVG versions of our favourite monkey.

For the time beeing, all the parameters are hardcoded into
the source, rather than being accessable from python, but still
i am quite happy with the result.

I hope i can do some further work on this on the weekend or so.

best,
Stefan

Hey,
Well it looks like you have everything in place already, but I gave it a shot.
In my opinion this should be an option in blender, like here
http://projects.blender.org/pipermail/bf-committers/2006-February/013687.html

But it’s neat anyway.
Here are three pictures made from the game engine…
http://home.bresnan.net/~snailrose/shots/

and a build here.
http://www.continuousphysics.com/ftp/pub/test/index.php?dir=blender/&file=GL2PS_Build.zip


from Rasterizer import *

# types ... 
GL2PS_PS  =0
GL2PS_EPS =1
GL2PS_TEX =2
GL2PS_PDF =3
GL2PS_SVG =4
GL2PS_PGF =5

# flags ...
GL2PS_NONE                 =0
GL2PS_DRAW_BACKGROUND      =1
GL2PS_SIMPLE_LINE_OFFSET   =2
GL2PS_SILENT               =4
GL2PS_BEST_ROOT            =8
GL2PS_OCCLUSION_CULL       =16
GL2PS_NO_TEXT              =32
GL2PS_LANDSCAPE            =64
GL2PS_NO_PS3_SHADING       =128
GL2PS_NO_PIXMAP            =256
GL2PS_USE_CURRENT_VIEWPORT =512
GL2PS_COMPRESS             =1024
GL2PS_NO_BLENDING          =2048
GL2PS_TIGHT_BOUNDING_BOX   =4096


type = GL2PS_PDF
flag = GL2PS_DRAW_BACKGROUND+GL2PS_OCCLUSION_CULL+GL2PS_BEST_ROOT+GL2PS_SILENT

GL2PS_Shot('test.pdf', type, flag)


Thanks,
snailrose

Wow, thanks,

impressive …

That would be too cool to see that in a Blender release.

I’m everyday more impressed by Blender.

Thanks,
Stefan

that’s insane I’m waiting for it from the begining of my work with blender game engine.

pleasse try to put it into next release of Blender.

thx jm

Nice!

In “Blendo.pdf” I see textures or not? How do I do this, I tested a quite complex file but there were no textures at all.

Regards,
Carsten