Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and

Wednesday, 26 November 2008

PShape class

Now that we are up to processing release version 1.0 we might expect developments in the PShape class as per this entry copied from

In-progress class to handle shape data, currently to be considered of alpha or beta quality. Major structural work may be performed on this class after the release of Processing 1.0. Such changes may include:

* addition of proper accessors to read shape vertex and coloring data (this is the second most important part of having a PShape class after all).
* a means of creating PShape objects ala beginShape() and endShape().
* load(), update(), and cache methods ala PImage, so that shapes can have renderer-specific optimizations, such as vertex arrays in OpenGL.
* splitting this class into multiple classes to handle different varieties of shape data (primitives vs collections of vertices vs paths)
* change of package declaration, for instance moving the code into package processing.shape (if the code grows too much).

For the time being, this class and its shape() and loadShape() friends in PApplet exist as placeholders for more exciting things to come. If you'd like to work with this class, make a subclass (see how PShapeSVG works) and you can play with its internal methods all you like.

Library developers are encouraged to create PShape objects when loading shape data, so that they can eventually hook into the bounty that will be the PShape interface, and the ease of loadShape().

Personally I,m not holding my breath, and for now at least I do not intend to inherit from this class, well unless Darrel thinks otherwise.

See my January posting to see my experiments with PShape and SVG.

No comments:

Post a Comment


Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby- and processing-3.2.2