processing doodles: metablobs

processing.org — nik @ 11:32 am

I haven’t updated in a while, but now I’m back! Now that I have more time, I’ll hopefully be able to post more now.

The following are some doodles I made last night with Processing. The metablobs are a simple particle system that use RGB values to determine attraction/repulsion. So… where are the particles and why isn’t there any color? It’s because the particles are mapped to a density map, sort of (I think?) how metaballs work. The result is twichy organic blobs that aren’t quite balls.


high contrast:

(more…)

how to scrape AXIS webcams with Processing

processing.org — nik @ 5:38 pm

axis

AXIS webcams are fun to play with because they are generally pretty easy to google, have fast feeds (depending), and sometimes allow user control. Of the thousands of AXIS cams online many of them are public. A somewhat well known trick to turn up thousands of AXIS cameras is to google for:

intitle:"Live View / - AXIS" | inurl:view/view.shtml^

Which will turn up thousands of (mostly) boring feeds. Every once in a while however, something really interesting turns up that you may want to scrape for some reason or another. The typical URL result for the cam is something like:

http://191.22.175.200/view/view.shtml (this URL doesn't work btw)

Which sometimes displays an image in mjpeg format and sometimes displayed with a cgi script. A cool thing the cams do (and cool if you want to scrape) is catalogue all previous images on a server somewhere. This means that if the cam is displaying a mjpeg which is a pain to deal with, never fear! To access plain ol’ jpegs from AXIS web software you need to look here:

http://191.22.175.200/jpg/1/image.jpg?(UNIX TIME)

Where the Unix time is generally a big number. This makes the whole process pretty simple from here on out, as that is simply the location you need to query to get fairly up-to-date images from that camera. The directory structures sometimes change, and sometimes finding the jpeg URL is as simple as viewing the source of the AXIS camera page. Also, especially on faster camera feeds, the main AXIS page occasionally links to a mjpeg which is tricky to deal with.

Processing sketch:

//scrape AXIS web cameras with processing.
//please don't be a jerk with this sketch.

import java.util.Date;
PImage cam;
Date d;
float last_millis;

void setup(){
  size(320,240);
  d = new Date();
}

void draw(){
  cam = loadImage("http://somedomain/jpg/1/image.jpg?"+d.getTime());
  image(cam, 0,0,320, 240);
  last_millis = last_millis - millis();
  println(last_millis);
  last_millis = millis();
}

Pretty simple right? All the math with milliseconds can be deleted, the code is there to see the difference in time between the last time an image was downloaded. Downloading discreet jpegs causes some lag and is a lot slower than using a conventional browser. Also, remember that d.getTime() gets the current Unix time — you can always change that to whatever, assuming the webcam existed at that point.

all these triangles!

processing.org — nik @ 4:10 pm

yay! Finally uploaded something with fine lines to vimeo that didn’t get entirely screwed up by the compression process. Animation Codec @ 720×480 with lots of keyframes seems to do okay.

all these triangles! from nik hanselmann on Vimeo.

working out these blocks

processing.org — nik @ 5:41 pm

working out these blocks from nik hanselmann on Vimeo.

simpler times from nik hanselmann on Vimeo.

more particles

processing.org — nik @ 7:37 am

still figuring out how to compress for Vimeo

particles from nik hanselmann on Vimeo.

bezier polygon test

processing.org — nik @ 1:59 am

bezier polygon test from nik hanselmann on Vimeo.

vimeo compressor is awful.

playing with texture

processing.org — nik @ 12:22 am


element 2 (drips)

processing.org — nik @ 7:28 pm

Sort of cheating by going off yesterday’s work, but added some drips.

element 1

processing.org — nik @ 10:01 pm

As part of a commitment with Nick to make work everyday for the rest of the quarter, I present “Element 1″ – the first in a series of Processing sketches.

wrdty links visualized

processing.org — nik @ 5:17 pm

I mapped out my little corner on the Internet with Processing. Now to make it interesting…

Next Page »
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2010 nik’s blog | powered by WordPress with Barecity