Surface Physics Demo Part 1

18 Feb 2009 00:11
Last Modified
13 Jan 2013 18:06

I've recently been doing some work on a physics engine sample for Microsoft Surface. The principal purpose of this work was to investigate how adding physical characteristics to virtual items adds to the realism of a Surface experience. The work had three main areas of focus:

  1. To add physical behaviour to virtual items in a Surface experience
  2. To combine physical behaviour with 3D WPF templates, textures and lighting sources
  3. To demonstrate how the object recognition capabilities of Microsoft Surface can be used to interact with these items

In addition to these points, I wanted to provide this functionality within a WPF layout control closely analagous to the Surface ScatterView control. In this way, it should be relatively easy to swap out a ScatterView implementation for a physics-based alternative.

Here's a video to illustrate the key features for this post.

Video 1. Surface physics demo.

The video is divided into the following sections:

Basic Interactions

Basic collision detection & response between circles, rectangles, and polygons. Notice that one can hold onto a given shape and flick other items into it. The held shape is affected by the collision but "springs" back to place. The items are all set to be the same density, so the size is proportional to the mass. The walls are "soft" and result in springy collision, rather than a hard collision between objects.

Basic Forces

Illustration of directional forces (basic acceleration) and point forces (a gravity algorithm). Notice that point forces with low drag result in a chaotic rotational motion - heavier items accrete towards the gravity source, and lighter items rotate futher away. Multiple point forces can be added. Combinations of directional and point forces is also possible, e.g. "hanging" an object of suitable mass below a point force. Note also that the physical tags (poker chips) have a virtual presence and result in collisions.

3D Objects and Materials

This section illustrates some lighting and textures, e.g. "wooden" and "marble" tiles. The lighting is consistent between objects, in this case pointing from lower left to upper right with respect to the camera position. Patterns tiles have image textures generated in code. In this example they simply use black and white brushes, but one of the great things about WPF is that I could as easily use different image brushes and, for example, "inlay" different wood textures to form the same pattern.

More Interactions

This section illustrates the use of "fixed" objects, with and without directional forces (actually the "fixed" objects are just non-selectable items of very large mass). It also illustrates some of the object recognition of Microsoft Surface. Ordinary business cards placed on the Surface become part of the "virtual" world. One can also use other physical objects (e.g. brochures, hands etc) to "sweep" items.

Configuration and Debugging

This screen allows configuration of just some of the properties of the physical environment, such as "bounciness" (restitution) of items and walls, directional and angular drag, directional forcees, maximum directional and angular velocities etc. It was also an invaluable tool in debugging the build as it shows positions and vectors graphically.

I've included some screenshots below.

Miscellaneous shapes

Figure 1. Miscellaneous shapes

Wood textures

Figure 2. Wood textures

Pattern textures

Figure 3. Pattern textures

Visual debugging

Figure 4. Visual Debugging

In the next article I'll describe some more physics-related and Surface-specific features of this framework.


16 Dec 2011 00:34
Hello Dave,
How are you? Hope, everything is OK with you. Dave, I am doing my dissertation on Microsoft Surface. My project topic
is simply like that when a student put their microsoft mobile on the surface unit, next a menu will be displayed (via tagging)
(Menu: Timetable, exam results, news, pictures, contact etc) If student wants, he/she should be able to take .pdf
on their mobile by drag&drop. My supervisor wants me to do by web service this transaction. I am really get stuck on this process.
Would you please give some ideas how I can do that? I will be really glad for you suggestions. Thank you very much in advance. I could not find your e-mail, sorry to sent here :(

Add Comment