fry
Status 12 January 2006
Jan 12th , 2006, 5:01pm
happy new year everyone! casey's already posted about the site, so i'll go with some of the environment/coding stuff.. the current top priorities are pdf and sound. pdf is a priority because of how it affects api. essentially, we're adding a feature where you can call size(400, 400, PDF, "poo.pdf"); that will create a pdf file to be drawn into. just like the opengl renderer, you'll use the regular p5 api to make things happen. (the file needn't be called poo). this gives you really nice vector output (images/bitmaps won't be supported initially, but fonts, lines, shapes, etc all look fantastic). the other important part of this is that it's not just for pdf, but for any sort of renderers that people want to plug in. so the SVG PGraphics that was posted a little bit ago will be able to use this mechanism too, and the various postscript/illustrator libraries could be modified to use this scheme. pdf was my target because of its superiority in creating files that are easily distributable. postscript/illustrator are easier to write, but require that the recipient can read postscript (macs with conversion by preview.. but that's a painful conversion with a big file, and no PCs without extra sw) or that they have illustrator installed (paying big momma macrodobe). they also render very quickly (if low quality) in adobe reader, so it's easy to iterate when reworking a complex image. for better rendering, a pdf can be opened in illustrator, though that's much slower. in the past, all my vector work has been done with my own illustrator library, and while i like the flexibility it provided, i've found this frustrating because of how illustrator breaks down with complex files. for instance, this was really painful: http://acg.media.mit.edu/people/fry/chromosomes/13-icp/ one of the fundamental problems being that a program like illustrator has to load all the objects in the file for editing (rather than just rendering, like acrobat), so the memory and cpu requirements are significantly higher. during the work process, this is a frustration because lots of times it's a matter of checking to see if a new color or line weight worked properly. to go with size(), beginRecord() and endRecord() are also being added, which allow you to record just a section of the commands out to another renderer (whether PDF or others). this can be used inside draw in the same style as saveFrame(), for instance. finally, there's beginRaw() and endRaw() (some of this naming might be.. ehm..) which will capture the raw triangle and line stream from the 3D renderers (P3D and OPENGL), allowing you to write the output to a 2D format like PDF or SVG or whatever. a preliminary version of this code was used to create the image for this cover: http://www.nature.com/nature/journal/v437/n7063/index.html where it was rendered from this piece: http://benfry.com/isometricblocks/ but from a much larger set of data.. thousands and thousands of triangles, along with all the triangles from the 3D type (ooh! vectors for 3D type too! yum!) as with the others, it can be used with any renderer, but it'll mostly only be useful for things that write PDF or SVG or DXF or other three letter acronyms that make you happy.