loading

Archive for March, 2007

flight404

Mini-tutorial: Additive Blending

I have been getting a few requests lately about the hows and whys of additive blending so I thought I would whip up a quickie little tutorial to get those interested parties on the path to easy glowiness. But first, the standard disclaimer.

I AM NOT A GOOD TEACHER!!! Here is why. I dont really know OpenGL. I dont know much about the limitations of JOGL either. What I do know is that with Processing, I can make OpenGL calls that can do great things but as for why they work or why they might be better or why I didnt optimize them further, the simple answer is that I am learning just like the rest of you. So please keep these 2 points in mind when you read the rest of this post.

1) If you have problems with the source code, please research the answer yourself. I wont be able to help you understand why you are getting an error with Processing v.123 on Windows running Vista with 2 webcams attached and Java version 1.4 with a cat on your lap and the right mouse button pressed. I would probably just refer you to the Discourse section of Processing.org.

2) If you can improve this code or help me understand more about why it works, please post your comments here instead of emailing me so that others can benefit from your knowledge. Im sure there are ways to make the following info much tighter and stronger… so chip in your 2 cents so we can all be a bit richer.

On the left is a screengrab from the supernova project without any blending. On the right, I have added additive blending and disabled the depth test. Suddenly, the orb glows are more glowy and the overlap issue goes away entirely. Lets look at the code.

First, you will need to make a new PGraphicsOpenGL and GL object. Before you can do this, you need to make sure you import the proper libraries. Stick this code in with your other import statements if you have any. The top one makes sure you can use the OPENGL renderer specified in your size() method, and the second is the JOGL stuff you will need.

import processing.opengl.*;
import javax.media.opengl.*;

Then you make your PGraphicsOpenGL and GL objects.

PGraphicsOpenGL pgl;
GL gl;

In your setup code, you will need to define these pgl and gl objects so put in the following after your size() method.

pgl = (PGraphicsOpenGL) g;
gl = pgl.gl;

Almost there! The only thing left is to do the additive blending magic. It is soooo easy! You will kick yourself. Stick this at the beginning of your draw method.

pgl.beginGL();

// This fixes the overlap issue
gl.glDisable(GL.GL_DEPTH_TEST);

// Turn on the blend mode
gl.glEnable(GL.GL_BLEND);

// Define the blend mode
gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE);

pgl.endGL();

Voila! Glowy good times. The BlendFunc takes several parameters. Check here for a sample as to why I dont bother getting too invested in the ‘why’ this works.

Go and glow.

Douglas Edric Stanley

Laboral

So I’m back in my hotel taking a quick pause before heading back to this huge exhibition, where I plan to finish filming the other installations. They apparently see things in a big way here, although I doubt how long they can keep it running at this scale. To give just one example: various persona from the digital arts community were flown in from all over the world, just to be here for the opening, instantly giving it the feel of one of those internationale festivals where you meet all the same people over and over again. And then there is the expanse of historical digital, electronic or mechanical works; it’s quite staggering, given the cost of just the equipment for such a show. At the Feedback exhibit this makes an interesting mix: Eddo Stern, Mary Flanagan, Nam June Paik, Sol LeWitt, Vera Molnar, Hans Haacke, Lygia Clark, Marcel Duchamp, Marie Sester, Christa Sommerer & Laurent Mignonneau, Paul Sermon, Roman Verostko, JODI, Jennifer & Kevin McCoy, Casey Reas, Harold Cohen, Cory Archangel, Manfred Mohr, Wolfgang Staehle, David Rokeby, etc. And I’ve only mentioned half of the artists.

DSC00782.JPG
DSC00813.JPG
DSC00807.JPG

Then there’s our exhibit where I absolutely love Walter Langelaar’s nOtbOt, and of course the Pongmechanik, Furminator, 650 Polygon John Carmack, TFT Tennis, Darkgame, etc. Not bad. Not bad at all.

Note: I was lucky enough to take this quick snapshot of Invaders! as it passed by on the regional television, followed by the lovely Rosina Gómez-Baeza Tinturé.

DSC00800.JPG
DSC00798.JPG
DSC00799.JPG

P.S. I’ll write more about the coding-part later. But just for the record, I ended up writing everything in Processing from scratch with about 2 days of coding mixed with another two days of installation troubles. It uses the OSC, OpenGL, Camera, and ESS libraries for Processing. The tracking software took about two hours, and half of that was just making some little adjustments. Amazing how fast you can make a working installation on-site with Processing.

Andreas

Glitch

misprint
Eigentlich wollte ich nur mal kurz die TileSaver Klasse von Marius Watz antesten, mit der man großformatige Screenshots von seinen OpenGL Sketches machen. Da das Speichern aber über mehrere Frames läuft und als Sketch ein Visual lief bei dem sich natürlich jeder Frame ändert war das Ergebnis nicht ganz wie erwartet. Mehr davon bei Flickr.

Andreas

Glitch

misprint
Eigentlich wollte ich nur mal kurz die TileSaver Klasse von Marius Watz antesten, mit der man großformatige Screenshots von seinen OpenGL Sketches machen. Da das Speichern aber über mehrere Frames läuft und als Sketch ein Visual lief bei dem sich natürlich jeder Frame ändert war das Ergebnis nicht ganz wie erwartet. Mehr davon bei Flickr.

marius watz

Stikkit API in PHP

I've started using Stikkit for my to-do lists. I like that it allows you to write mixed content in a single note, so that you can keep dates, contacts, to-dos and little notes all in the same framework. It's not perfect yet, but it works for me. With the recent launch of the Stikkit API things should get even more interesting.

Here's a quick demo of how to access your most recent Stikkits in PHP (requires PHP 5, HTTP_Request and Services_JSON):

<?php
require_once "PEAR/HTTP/Request.php";
require_once "JSON/JSON.php";
 
$req =& new HTTP_Request("http://api.stikkit.com/stikkits?api_key=xxxx");
$req->setMethod(HTTP_REQUEST_METHOD_GET);
$req->addHeader("Accept", "application/json, */*");
$response = $req->sendRequest();
 
if (PEAR::isError($response)) echo $response->getMessage();
else {
  $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
  $value = $json->decode($req->getResponseBody());
  printNestedArray($value);
}
 
function printNestedArray($a) {
  echo "<ul>n";
  if(is_array($a))  {
    foreach ($a as $dbkey => $value) {
      echo "<li>".htmlspecialchars("$dbkey: ");
      if (is_array($value)) {
        printNestedArray($value);
      } else if(!is_object($value)){
        echo "'". chop($value)."'n";
      }
    }
  }
  else echo "$a</li>n";
  echo "</ul>n";
}
?>

Comment posting problem is fixed

I didnt know that comment posting had been broken up.
Now its fixed.

Sorry for everyone who faild to post comment to my blog :-(

Pascal Chirol

DDD . AAA Quels outils critiques pour comprendre le design graphique ?

DDD : Exposition Lux. Scène nationale de Valence 28 mars -16 avril
AAA : Colloque & Exposition École régionale des beaux-arts deValence
28 et 29 mars.

Le design graphique peut être défini comme le traitement formel des informations et des savoirs. Le designer graphique est alors un médiateur qui agit sur les conditions de réception et d’appropriation des informations et des savoirs qu’il met en forme. Intervenant dans un maillage complexe de relations — tissées notamment entre un lieu et son environnement, les informations et les médias, l’actualité et l’histoire, le commanditaire et les destinataires —, le designer opère du même coup sous une certaine menace, celle de son instrumentalisation, de sa réduction à la stricte codification des normes et des discours dominants. C’est pour mettre au jour et déjouer cette menace que plusieurs designers signèrent en 2000 le manifeste First Things First (D’abord l’essentiel) qui préconisait l’invention de‘formes de communication plus utiles, plus durables et plus démocratiques’. Dans le sillage de ce manifeste, ce colloque envisagera le design graphique comme un projet aux dimensions pragmatique, éthique et politique, en dialogue constant avec la pensée théorique et critique. Son ouverture internationale est à cet égard essentielle: la Hollande, la Suisse, les États-Unis, d’où sont issus plusieurs intervenants, sont parmi les pays où le design graphique est intégré dans la culture et, en particulier, dans celle des commanditaires. À ce titre, les designers graphiques invités constituent des références avec lesquelles il est possible d’enrichir une réflexion qui semble émerger en France.

ddd aaa Avec:
Madeleine Aktypi, Pierre Bal-Blanc, André Baldinger, Max Bruinsma, Anne-Marie Christin, Laurent Fétis, Luc(as) de Groot, Laurent Gutman,
Pierre-Damien Huyghe, George Legrady, Giovanni Lussu, Armand Mevis,
Philippe Millot, François Rappo, Monique Sicard, Catherine de Smet, Gerard Unger, Vier5.

Andreas

An Evening with Aristid Lindenmeyer

2007 03 17 14:21:06

Eigentlich fand ich L-Systeme immer ein wenig langweilig. Durch Zufall bin ich auf diesen Artikel von Joshua Davis gestoßen in dem er an ein paar Beispielen zeigt was man L-Systemen außer Pseudobäumen noch so machen kann. Zum Glück muss man für Processing nicht alles neu erfinden. Einmal kurz nach processing und lsystem gegoogelt und man hat schon mal einen guten Ansatzpunkt.

Wenn man nun, wie in Joshuas Artikel beschrieben, statt einfacher Linien für die Äste Grafiken zeichnen lässt bekommt nach einigem rumprobieren recht ansehnliche Ergebnisse. Gestartet hab ich mit importierten SVG Grafiken aus dem NEUBAUWELT Buch (oberes Bild). Danach dann einige Spielereien mit Bezierkurven und festen Winkel für die Verästelungen. Alle Bilder gibt’s hier.

Das gute an Processing ist, dass man das ganze als pdf exportieren und in Illustrator impotieren kann wobei alle Elemente als Vektorgrafik übernommen werden. Womit man eine gute Ausgangslage zur Weiterverarbeitung als Cover, Flyer etc. hat.

2007 03 26 23:14:37

Andreas

An Evening with Aristid Lindenmeyer

2007 03 17 14:21:06

Eigentlich fand ich L-Systeme immer ein wenig langweilig. Durch Zufall bin ich auf diesen Artikel von Joshua Davis gestoßen in dem er an ein paar Beispielen zeigt was man L-Systemen außer Pseudobäumen noch so machen kann. Zum Glück muss man für Processing nicht alles neu erfinden. Einmal kurz nach processing und lsystem gegoogelt und man hat schon mal einen guten Ansatzpunkt.

Wenn man nun, wie in Joshuas Artikel beschrieben, statt einfacher Linien für die Äste Grafiken zeichnen lässt bekommt nach einigem rumprobieren recht ansehnliche Ergebnisse. Gestartet hab ich mit importierten SVG Grafiken aus dem NEUBAUWELT Buch (oberes Bild). Danach dann einige Spielereien mit Bezierkurven und festen Winkel für die Verästelungen. Alle Bilder gibt’s hier.

Das gute an Processing ist, dass man das ganze als pdf exportieren und in Illustrator impotieren kann wobei alle Elemente als Vektorgrafik übernommen werden. Womit man eine gute Ausgangslage zur Weiterverarbeitung als Cover, Flyer etc. hat.

2007 03 26 23:14:37

Daniel

Run Lola, Ruuuuuuuuuuuuun!


Click to Watch

Working on a demo for the MPE system consisting a grid of cells, each playing the film Run Lola Run at 60×32 pixels. Each cell is one frame behind (or ahead) of its left (or right) neighbor. The idea here is to ultimately have enough pixel space to display the entire movie all at once (much like Brendan Dawes’ Cinema Redux), only in motion. Too bad this is quite a blatant copyright violation.

Seriously, Run Lola Run.  Run! Seriously, Run Lola Run.  Run!

(Special thanks goes to Chris Kairalla for suggesting “Run Lola Run” as the source content.)

Daniel

Single Parent Ecosystem


Simple EcoSystem

This week, in The Nature of Code, we’re talking about genetic algorithms. A genetic algorithm is a search technique that involves a simulated population of candidate “solutions” (represented by virtual chromosomes) that evolve towards an optimal state. The process is a computational model of principles from biological evolution, such as selection, inheritance, crossover, and mutation.

One of the more challenging aspects to developing a genetic algorithm is coming up with a good “fitness function” for your candidate solutions, i.e. how well does this candidate solve the problem? Without a good fitness function, you won’t get anywhere since the function determines the likelihood of reproducing for the next generation. This is Survival of the Fittest in code.

Nevertheless, as per Flake, a better natural selection catch-phrase might be “Survival of the Survivors.” In the biological world, there is no fitness “function.” The longer you survive, the more likely you are to reproduce.

With that in mind, the above example is a simple evolution simulation, where the simple ability to live longer affords creatures (called “bloops”) a greater chance of having a child (the example uses asexual reproduction for simplicity, but could be modified to incorporate two parents). A bloop’s DNA determines its size and speed (the larger it is, the slower it moves.) The bloops wither away and die unless they find food, in which case their strength increases, causing them to they survive longer and hopefully reproduce.

There’s nothing inherently interesting about this example (other than as a demonstration of the technique itself) and it yields a fairly obvious result:

Bloops that are too big can’t move, don’t find food, die, and aren’t very likely to have children. Bloops that are tiny can move around very quickly, but aren’t terribly likely to find food either because of their small size. After about 10 minutes or so of running, the bloops evolve towards a “midpoint” where a reasonably sized, reasonably fast family of bloops take over (see above screenshots for “before” and “after.)

Since color is encoded into the genes, you can follow bloops from generation to generation (though it should be noted that color plays no role whatsoever in a bloop’s ability to survive.)

eskimoblood

lsystem

Playing around with l-systems

Author: eskimoblood

Keywords: processing.org lsystem

Added: March 27, 2007

marius watz

Two Flickr gripes: Black thumbnails, private photos

As great as I think Flickr is, I still wish they would fix or add two things:

1. Black thumbnails: Whenever I upload an image bigger than maybe 4000 x 4000 pixels Flickr is unable to generate a thumbnail, and the picture appears as a black square except when viewed in its original size (see this example.) It's in the Flickr FAQ, so it's a well-known issue.

I realize that Flickr is primarily a photo site and that most users will be uploading images in the 5-10 megapixel range, but I really wish they would fix this.

2. Toggle private photos in photostream: I wish there was an option to not show my non-public photos when I browse my own photostream. I regularly upload images that I want to have easy access to but which are not intended for public viewing. Often these are batches of up to 30-50 images. After uploading a private batch I have to click through pages of private images to get to the public ones.

I know I can just sign out to see my photostream as other users would see it. But that seems kind of, well, stupid. A simple option to filter by privacy setting would be a great help to any Flickr power user.

Always save some sugar for last: Flickr recently introduced a nice new feature called Collections, which tackles the issue of having a lot of sets. Collections allow users to organize their photo sets so that related sets can be grouped together. Have a look at my Collections for an example.

Collections get a mosaic of images as icons, which can be randomly generated or painstakingly hand-selected. There is also a new option to choose the layout for your photostream to display collections rather than sets in the right-hand column. This is the first time users get any say in the layout of their Flickr "home pages", it would be interesting to see if more customization features get added in the future.

I only wish there was an option to simply have single images as collection icons. The new photo mosaics give a decent impression of the contents of a collection, but they can look a bit messy and not as attractive as a single good image.

Processing.org Updates

Mob Zombies and new software from Suzung Kim added to the exhibition.

Mob Zombies and new software from Suzung Kim added to the exhibition.