Auto-Detection of Contours from Game Level Z-Buffer



I put together a quick and dirty vj-looking app to talk about our Metrics Element product. It's run on a Mac Power Book, written in C++, uses OpenGL and some OpenCV algorithms.
I also integrated the WiiMote with it so you can see a real-time graph of the accelerometers. I also use the keypresses on the WiiMote to change the little b/w videos (which are all old-school footage from a GM film from the 30's on scientific measurement).
Anyway, it was a mind-trip of a piece that I think also successfully conveys some of the core ideas of Metrics and Analytics.
The whole idea was to find a way to make it exciting and interesting to talk about Metrics from an app.
After much pain and agony, I have finally figured out how to build WebKitQt and QtLauncher (the demo app) on Mac OS X.
It's probably not supposed to be this hard, but there's a dearth of info on how to do this (I suspect because the guys at Trolltech are busy trying to get Qt 4.3 out the door).
In any case, I wanted to use WebKit in a spidering app I'm working on using Qt 4.3 and C++. Even though I am a 100% Mac-based developer these days, I still want my apps to be cross-platform, so I opt for Qt over Cocoa/Objective-C. This meant that I had to follow the Apple/XCode dylib rules as well as install a few libraries that weren't on my system by default.
1 - Using fink, I installed flex and bison (separate installs).
2 - Then I had to specify QTDIR environment variable (QTDIR=/usr/local/Trolltech/Qt-4.3.0beta) (then export QTDIR)
3 - add QTDIR to your PATH environment variable (PATH=$PATH:$QTDIR/bin) (then export PATH)
4 - make sure you have NOT specified a QMAKESPEC in your bash profile (so echo $QMAKESPEC should not return anything)
5 - grab the latest WebKit source using SVN (see webkit.org for instructions)
6 - run ./WebKit/WebKitTools/Scripts/build-webkit
This should make the build script compile using qmake.
7 - copy the dylibs from /WebKit/WebKitBuild/Release/lib to /usr/lib
QtLauncher should now run (located in /WebKit/WebKitBuild/Release/WebKitQt/QtLauncher).
In order to compile/edit this in xcode...
8 - in a terminal window - cd into /WebKit/WebKitQt/QtLauncher/
9 - run the following"qmake -spec macx-xcode"
You should now see QtLauncher.xcodeproj in that directory.
You may have to manually delete and re-add some of the Qt libraries in XCode, as well as adding the QtNetwork.framework, since I don't think it's added by default.
I'm sure I missed some of the details (since I typed this rather quickly), but this captures many of the small steps that tripped me up along the way.
I'm almost done with my Qt 4.3 and WebKit-based Internet spider.
It uses WebKit for webpage retrieval, rendering, and link extraction, and I also created a squarified treemap widget for visualization of different aspects of individual pages and the spidered pages.
Here's a preview...

Going back through some old files, I found a few images of my old Social Network Spider and Visualization System (SNS-VS) that I thought I'd post here. This is the Java-based spider interface (the SNS part of the system) circa 2005. I've started building a MUCH more advanced version based on Webkit and Qt 4.3. When it's done it will be WAY more powerful, fast, and reliable that the older spider, but for now it's nice to look back on the end-to-end system I build a few years ago.
It was multi-threaded and handled distributed spidering across an arbitrary number of heterogenous machines -- some pretty cool capabilities as far as spiders go (if I do say so myself).
These images are from another old project of mine (from 2005) where I built a little app that takes any image and converts it to a true 3D mesh based on the pixel intensity (essentially). Although I never integrated this into my final dissertation software system, I always found it really fun to play with. Once the image was converted it was fully navigable as a "terrain." The texture for the mesh could either be a fractal colored terrain based on the height of each pixel, OR a pixel from the original image. This required some clever texture sampling -- and the coolest part was that the app could export to .obj format so the whole thing was editable/viewable in your favorite 3D modelling package (like Maya or 3D Studio Max).
This is a fully scriptable node-graph editor I built recently using Qt 4.3 and QSA. I have extended the DiagramItem example (ships with Qt 4.x sourcecode) to allow the user to draw the shapes (like in visio), as well as style the stroke, fill, and double-click to add labels to each node.
I then integrated the QSA engine so that you can use ECMA script to extend the interface. At the moment, you can procedurally change the formatting, size, etc. of each node or link; as well as topology checking. This means that you can write custom event handlers in the script editor (right-hand drawer in screencap) to change the color of node based on how you have linked them up. This is extremely useful for things like checking for circular, ping-pong, or other types of invalid references.
It can also read in an XML file and convert it to a nodegraph (based on a standard format). Eventually I will make it so it can also write to XML.
Many of the gestures and the overall design gestalt are drawn from OmniGraffle -- one of my absolutely favorite apps ever.
I will eventually be open sourcing this, but it'll take me a bit more time to clean it up -- especially with my job and dissertation work taking priority ;)
This page contains an archive of all entries posted to Sean Zehnder's Blog in the Code category. They are listed from oldest to newest.
Design is the next category.
Many more can be found on the main index page or by looking through the archives.