To the stars with Gear VR!

Getting more serious about VR… the HTC Vive is extremely cool, but quite some investment for starters. Decided to get myself a decent Android phone and a Gear VR, and started porting my astronomy app Cor Leonis to Unity.

Good progress so far! Stars, planets, moon, and sun are all in, reading device location and compass is a breeze in Unity, so I can already have a view of the current night sky in VR 🙂

Now on to make things pretty and creating a cool experience!

Arduino Prototyping: It’s a clock!

Over the past few months, I digged more deeply into the Arduino platform. One ongoing project is a clock with moon phase display (since I already implemented the computations for my astronomy app, Cor Leonis). I started out with an LED matrix and 7-segment displays like this:

Tons of wire!

Over time, I decided to use 2 8×8 LED matrices, switched to a smaller Arduino compatible board (Adafruit Pro Trinket), and ran it on batteries:

There’s also a button to switch between views now.

It’s far from done, but I find it amazing how much I already learned from this relatively simple project… a refresher on basic electronics (resistors, capacitors, etc.) and soldering,  manual LED matrix display multiplexing, more on LEDs than I ever wanted to know, RTC clock chips, LED display driver chips, shift registers, step-up/down voltage converters, debouncing HW buttons, I2C bus wiring and communications, calculating power consumption and battery lifetime, and so on and so forth. Next up is sensors: I would like to switch views just by waving my hand (and see how robust that is), instead of having to walk over and press a button.

Cor Leonis 5.0 released

After a looooong break, I picked up development on my astronomy app, Cor Leonis, again. The latest version 5.0 is available now for iOS devices in the Apple App Store. The one big feature which justifies the major version jump: the moon! While I was working on the moon info panel, I also beefed up information about the planets in our solar system a lot. Hope you like it!

Bouncing Ball Physics

To revive my Blender skills, I’ve been tinkering with setting up a simple bouncing ball animation. How do you keyframe this properly, without running a physics simulation? There are tons of tutorials on the web on basic bouncing ball demos, but few go into details about what a physically plausible bouncing ball trajectory would look like. As it turns out, with an ideal bouncing ball, there are only a few basic ingredients:

  • The path is obviously a series of parabolas
  • With each bounce, a roughly constant fraction of the energy is lost. The exact value depends on the material of the ball – the magic term is “coefficent of restitution” (COR). The height of each parabolic arc is f * previous_height, where f is in the range (0,1).
  • Assuming no slowdown in the horizontal direction, the distance between touch down positions (resp. duration of a bounce) shortens with the square root of f.

So far, so good, but is this model realistic? I did a few experiments tracing bouncing ball trajectories from video.

First, a tennis ball (at 50 fps):

Doing rough calculations based on the pixel positions of the ball’s center, the behavior is close enough to the model, with a COR of roundabout 0.55. Great.

Second, a very squishy rubber ball:

Surprise: The same calculations show that this ball keeps bouncing a bit higher than expected every time! The COR raises from 0.34 to 0.55 over four bounces. I even repeated the experiment, with similar results. Apparently, a non-constant COR is not unusual at slow speeds, as mentioned e.g. in the Wikipedia article on the subject.

Smoke Simulation

smoke simulation

As a first step towards a full-featured fluid simulator, I am currently working on smoke simulation, and now got something running for the simplest case of smoke in an open volume, i.e., without any solid objects or boundaries. The attached video shows 10 seconds of simulation with a small heat / velocity source at the bottom left. Looks neat already!

The implementation follows the approach laid out in the SIGGRAPH 2007 Course Notes on Fluid Animation. In brief, this is a Semi-Lagrangian advection scheme, running on a 128^3 grid. My current single-threaded CPU implementation is ridiculously slow (about 4 frames / minute on my i7 Laptop), so I am going to investigate parallelization, probably with OpenCL.

Only the ray marching volume shader utilizes the GPU so far.

I’ve had problems playing the video in firefox – you might want try another browser!

Thesis work in medical physics: volumes and surfaces

A long-running side project has recently come to fruition: My master’s thesis in the realm of medical physics got accepted! You can find the full (German) text under the prosaic title “Vergleich von Volumenmodellen” in the publications section on this site. No surprise, it’s dealing with 3D graphics – I used the chance to have a peek at a few interesting problems around volume representations.

The numerous representations of three-dimensional objects fall into two broad categories: surface models and volumetric models. Depending on the application, one typically chooses one or the other. Triangles meshes, for instances, allow for extremely fast visualization of surfaces on modern PC hardware. In medical imaging and scientific visualization, though, volumetric data is often prevalent.

Since many algorithms are using either surfaces or volume data as input, it is often necessary to convert between different representations to perform desired operations on a data set. Mathematically, the task corresponds to finding an implicit form for a parametric surface description, or vice versa.

In this thesis, I am discussing the connections between triangles meshes, and different volumetric shape representations: binary voxel grids, discretized distance fields, and tetrahedral lattices. Algorithms for volume visualization, conversion between representations, and for making cuts and selections are demonstrated. In the practical implementation, a focus was put on making use of current GPU-based techniques to speed up not only visualization, but also the geometric algorithms.

Ocean water simulation

At Scanline VFX, we were doing a whole lot of CG water for the movie “Megalodon – Hai-Alarm auf Mallorca”. I leave it to you to rate the movie, but, hey: the project got me a credit on The Internet Movie Database. My part in this was the R&D on ocean water surface simulation.

I ended up doing a variation of the FFT-based approach put forth by Jerry Tessendorf, and combined it with an implicit model representation to allow additional modification of the ocean waves by blended shapes. You can watch a short scene from the movie on YouTube illustrating the method. Around 0:38, you can nicely see how the simulated open water surface combines with the bulge of the shark-like shape under water.

Some shots also used a real CFD simulation engine, which was separately developed at Scanline.

Aside from the interesting work on the algorithms, it was very enlightening to turn this into a 3ds Max plugin that could be used by the artists in production. And the renderings they produced were nothing short of amazing.

Facial Animation and Modeling

Facial animation is, despite all advances on the technical front, still a challenge and a rewarding research subject. This might be the one-line summary of my PhD thesis, the outcome of my time at the Max-Planck-Institut für Informatik in Saarbrücken. In a few more words, I developed an anatomy-based modeling approach in conjunction with a physically-based animation system.

The title of my thesis is “A Head Model with Anatomical Structure for Facial Modeling and Animation”. You can find the full text in the publications section. Please also visit the MPII’s facial animation and modeling pages to learn more about this project.

Media recognition

Following is a loose collection of references to appearances of our (award-winning!) facial animation project in the media.

Beware, the following links lead to german language texts:

Aufmacher in der Saarbrücker Zeitung vom 25.4.2002 – kostenpflichtiger Archivzugriff
SaarLB-Wissenschaftspreis für System zur Modellierung und Animation von Gesichtern
Software gibt Mordopfern ihr Gesicht zurück (
Gesichter aus dem Computer (3Sat, zum Beitrag auf nano)
Wiederbelebung im Cyberspace (Focus Magazin, s.a. Heft 33/2003, S. 86)
Neue Software gibt Toten “lebendige Gesichter” (ORF ON Science)
Das lachende Phantombild ( Wissenschaft)

These articles are in english:

Skulls gain virtual faces (
Animation lets murder victims have final say (