In Part 1 I introduced a generic framework I have produced for a Surface-enabled WPF layout control which has basic physical interactions.
Aswell as demonstrating some additional physical behaviour, I wanted to focus this post on some Surface-specific features. One of several key tenets of Surface development is multidirectional applications. This is often overlooked, even when developing for Surface as the developer typically uses a standard development PC with a vertically-oriented screen. I should say that the radio buttons down either side of the demo aren't part of the framework I describe here - they are merely present to allow me to illustrate different features over several pages - so should be "ignored" when it comes to a discussion about multidirectional UI.
Let's jump straight into a video.
The video is divided into the following sections:
Other than adding some black and white "plastic" rounded tiles, I've included some "crystal" materials. These are 3D models of a typical facetted gem, with some suitable lighting and transparency. The colors are randomly generated each time the page is selected.
I'd wanted to add these from the start, as they are great fun to play with. Whenever a "spring" tile (another poker chip) is placed in the Surface, any selected items are joined to it via a spring, or piece of elastic. Muliple springs can be connected to multiple objects. When combined with directional forces the springs will "swing" accordingly. A basic spring algorithm is used, with a configurable spring constant and length (quite "loose" and "short" respectively in this sample).
360° Directional Forces
This section illustrates how a "dial" object (you guessed it, another poker chip) can be used to control the direction of a force. When placed on the Surface, the current direction is indicated and can be changed by rotating the object.
360° Directional Lighting
In a similar approach to the directional forces above, a "dial" object is used to control the direction of the dominant light source in the model.
Here are some further screenshots.
Note that these screenshots are from the Surface Simulator, so the physical objects (i.e. spring object, force, and lighting dials) are necessarily virtual.
In the next article I'll discuss 3D features.