danielt wrote on Jan 10th, 2010, 3:55am:Here's one I am interesting in reverse engineering:
http://www.openprocessing.org/visuals/?visualID=6744
I have asked the author but I think he's a bit reluctant to hold my hand as I wade through it (fair enough too).
There are a lots of p5. prefixes through this code. Now that I know the back story, maybe it's just his way of denoting what is java and what is processing in the sketch
Hi Dan, sorry for not getting back to you sooner. My dad passed away about 24 hours after my last email, which somewhat changed my focus.
Thanks to others poking around my (naughty) undocumented code to explain how it works.
Indeed, "p5" is a reference to "the sketch" (the main PApplet object), which I think is silly to call "parent", and is used to access the handy functionality provided in the "processing environment", such as all the drawing methods. As .pde files compiled using Processing (the PDE) itself, the classes all end up as "inner classes", and therefore have access to this functionality (since it is in the "outer class" created by Processing for setup(), draw() and so on), but this isn't the case for "normal" Java.
I don't know if this is a non-terrible way to do things, and since I haven't mapped out a plan for other types of related objects (widgets), it's really hard to say whether the object relationship I have is appropriate, and I hope I'm not leading you down a dodgy path! Having said that, I was relatively pleased with what I'd made without any additional research outside of your original program (except for the registerDraw() and similar parts, which I'd only just seen used myself).
-spxl