Tag Archive: “processing”
Collective Behavior Model interface
Here’s an update on the model. As a convenience for the purposes of debugging and experimentation, I’ve added a “dashboard” readout that can be used to display any variable. I’ve also added manual controls to adjust the behavior parameters while the simulation is running. It’s fun! You can cause the agents to clump together, disperse, or exhibit other apparent patterns. Lastly, I’ve added a rudimentary pause mode (bullet time, as I announced to all within earshot upon implementation).
Pausing is handy, but I expect it will need to be rewritten in a way that allows more continuous control of the simulation speed – slow motion or step-by-step modes would also be nice.
Still lots to work on and review in the model itself. In particular, I want to examine the turning rate code; I see a lot of jittery motion that suggests something may be off.
Want to see and hear more of this project? I can continue to post updates. Some will be more focused on the concepts of the model and some will be more focused on the implementation – for example, I don’t really know much about Java, so I may post code examples of whatever strikes me as clever or confusing.
Posted on Thursday, May 13th, 2010.
Processing Syntax Coloring in TextWrangler
Processing is based on Java. TextWrangler supports syntax highlighting for Java code, but it doesn’t automatically recognize that Processing uses Java syntax. So, head over to the Languages pane of TextWrangler’s preferences and click Add next to the Suffix Mappings list. Enter .pde
as the Extension and select Java as the language that should be associated with .pde
files.
Now if you open a Processing source code file in TextWrangler, it will be displayed with basic syntax highlighting.
Posted on Thursday, March 18th, 2010.
Online LDraw Viewer
Click here to view some digital bricks right in your browser.
It’s a quick late-nite first-draft online adaptation of the Processing LDraw viewer I’ve been playing with.
Posted on Tuesday, January 12th, 2010.
Setting up Andy’s LDraw Viewer
Andy has posted the Processing code for the nifty little LDraw viewer I mentioned in my previous post.
Processing gives you a decent among of guidance, but for your reference here’s what I did to get this up and running:
- Download and unzip
ProcessingLcad-Oct2008.zip
. - Rename the
LcadTest-Oct2008
folder toLcadTest01
in order to match the project file it contains. - Move the contents of the
LcadTest01/libs/
folder to your Processing sketchbooklibraries
folder. In my case, it is/Users/anoved/Documents/Processing/libraries/
. - Move the contents of the
LcadTest01/models/
folder to themodels
subfolder of your LDraw library. Alternatively, you can editLcadTest01.pde
to load a model of your choice. - Open
LcadTest01.pde
and editBaseDir
to identify your LDraw library folder. In my case, it is/Users/anoved/Documents/LDraw/
.
Lastly, if the capitalization of the LDConfig.ldr
file in your LDraw library does not match that specified later in LcadTest10.pde
, edit one or the other so they are in agreement.
Now you can take it for a spin. And, yes, this viewer can load files with Unix line endings. ☺
Posted on Monday, January 11th, 2010.
Beginning Processing
Processing is a system that makes it as straightforward as possible to do some pretty sophisticated graphics programming. Based on Java, it abstracts enough technical details to let you focus, more or less, on the basic logic of the idea you want to animate. From the web site:
It is used by students, artists, designers, researchers, and hobbyists for learning, prototyping, and production. It is created to teach fundamentals of computer programming within a visual context and to serve as a software sketchbook and professional production tool.
Check out the Exhibition for some examples of what’s possible and the Tutorials to see how easy it is get started. There is a great collection of examples for specific topics, too, most of which include illustrative applets embedded in the page. The ability to export Processing programs (or “sketches”) as applets is particularly appealing, although my understanding is that some features, such as file I/O, are available only in application or development mode. It works cross-platform.
I know I have encountered Processing before, but my current interest began as I read Andy Lynch’s description of a simple LDraw renderer he implemented as a Processing sketch. That lit a fire under some related ideas of my own that have been simmering for want of an optimal outlet.
But there’s more to my interest than digital bricks: if there isn’t already a decent library (which would be surprising, as many useful libraries seem to be available), I might be tempted to write a shapefile loader, if for no other reason than to complement the shapefile parser I once wrote for Chipmunk Basic. I think it could be fun to experiment with some raster GIS and remote sensing ideas in Processing, too. (Just get the spectral signatures – click, click, click – and you do it. That’s all what it is!) Last but not least, per its original intent, I can envision using Processing as a superior tool to visualize certain data.
What sort of Process will you invent?
Posted on Monday, January 11th, 2010.