Loading...
Logo
Processing Forum
So I've read about how to generate flattened PDF graphics from a 3D rendered scene, but it seems the beginRaw() method just flattens everything and does not remove hidden lines.

So, can anyone suggest a workflow, perhaps using third party software like Blender, for creating 2D vector graphics from P3D graphics in Processing? I know various approaches might have certain trade offs and I can't expect perfect results, but I would be interested in any information you can offer!


Replies(7)

when i've done this i've always done it in 2d (using PDF mode) and implemented the 3d rotation and hidden line removal myself. it's kinda complicated if you've not done it before...

hidden line removal is just a case of not drawing lines defining faces that point away from the camera - work out the normal for the plane and calculate the dot product of that and the camera vector...

alternatively, draw the faces in order, furthest from the camera first, and fill the polygons with the background colour (painter's algorithm)

but all this depends on the shapes being drawn... (mine were always quite simple - dodecahedra etc)
Thanks, kooogy. Yeah, I was wondering if maybe I would have to do my own z-sorting. It will make the project take much longer, though! It would be nice if some magic software would do it for me.


Are you talking about P3D in Processing 1.5 or before, or in 2.0?
Hi PhiLho, I'm working in 2.0, but I also have 1.5 available. Why? Are there some differences in this respect?
P3D in 1.5.1 is an emulated mode, where 3D is computed "by hand" on a 2D canvas.
P3D in 2.0 is based on OpenGL, so I guess that it isn't compatible with a PDF rendering.
Oh...I'll give it a try in 1.5 and see what happens.
Well, it's the same there. Maybe I'll just have to do the work of sorting my shapes. Actually, I have some ideas for things I can make that would just be made out of lines that could be flattened together.