In order to teach myself the basics of defining classes and constructing objects, I have assembled a sketch that combines a number of different objects - defined in separate Tabs.
But two of the more complex elements are not playing nicely together.
I'm trying to use a variation of the Sutcliffe Pentagon as a background (as explained by Matt Pearson in Generative Art) with a wonderful old algorithm for a kind of interactive petal-thing that I found on these forums - originally I believe by Chris B Stones.
The sketch runs just fine with the Stones-thingammy in the middle and the simpler bits going on around it. It is fast and wonderfully responsive. But when I add the Sutcliffe Pentagon to the mix it becomes really laggy and sluggish. Is there a way to make the whole thing play back quickly and smoothly - by optimizing my code, 'trimming excess fat', removing redundant commands, etc?
Or am I bumping up against the limitations of what Processing can be expected to do on an early 21st century desktop computer?
Any advice would be much appreciated!
PS: I'm very new to Processing. My background is in film and media - with a dash of Flash thrown in. So my expectations of frame-rate and smooth playback are derived from that paradigm.
I have long labored under the (mistaken?) impression that algorithmically-derived (vector) graphics play back more efficiently on a computer platform than pixel-based (raster) images derived from a camera - moving or still. So I'm assuming this has to do with my limitations as a rookie coder rather than the limitations of 'the medium'...
(I have removed the sound file from the sketch in the code that follows.)
I hacked this together rather roughly by ripping some code out of an old sketch on Recursively drawing arc segments by gneumatic and then turning it into a class.
But I'm sure there's a more elegant way to generate a shape like this with the same controllable elements.
It bothers me that there's this huge confection (it really is a cake!) of colors underneath it all, being masked by a fat black blob sitting in the middle of the screen - instead of a slim ring of multi-colored arcs.
Any ideas?
PS This is just one piece of a larger work which will be controlled by two handheld devices - one running a TUIO multitouch screen and the other transmitting x,y,z accelerometer data via OSC - to constantly vary the hue, saturation and brightness values of the different-colored segments on this ring.
It had occurred to me that it might be better to create concentric circles of different colors to achieve a slightly different but equally viable effect.
Please note: because of compatibility issues involving the numerous pieces of this jigsaw I have to use Processing V1.5 for all this.