Surface 2 Physics Download

By
Dave
Project
Published
27 Jul 2012 14:30
Last Modified
13 Jan 2013 18:04

I've finally migrated the original Surface Physics v1 library and sample to .NET 4 and the Samsung SUR40 with Microsoft PixelSense.

For many apps, migrating from the Surface v1 to the SUR40 is very easy, and simply involves a search & replace of controls in the Surface v1 namaspace with their new versions. In my case, because I had to do some lower-level contact-handling, things were a little more complicated.

The sample is broadly similar to the previous version, except that I have removed the "interactions" page, which relied (amongst other things) on the API accurately reporting blob orientation. Blob orientations are now only reported as either 0 or 90°, and I didn't have time to implement the raw-image processing required to replicate the behaviour originally demonstrated on this page.

The following downloads are available:

  1. Surface Physics Sample (install), .msi (zip'd), 860Kb. The sample application for demonstrating the physics library and layout control.
  2. Surface Physics Sample (source code), Visual Studio 2010 Project (zip'd), 730Kb. Source code for the the sample application.
  3. Physics Library (binary), .dll (zip'd), 17Kb. The physics library and layout control.

The Readme for the v1 sample application may prove also prove useful.

You'll need the Microsft Surface 2 SDK, available from the MSDN site here, and access to a SUR40 or at least the Input Simulator in the SDK.

See the project archive for older posts, and the gallery for screenshots.

Comments

By
Markus
9 Aug 2012 09:00
Hey, I tried to use your Physics extension for my Project. My Problem is I need to change the orientation of PhysicItems (Scatterviewitems). I've seen in PhysicsViewItem : ContentControl is only a get for orientation. Is there an easy solution to make it possible to rotate the physicitems like scatterviewitems ? Thank you in advance for your answer.
By
Dave
9 Aug 2012 11:16
Hi Markus,

Check out the static method PhisicsCanvas.SetOrientation(UIElement element, double angle). PhysicsViewItem inherits from UIElement, so you can use this to set an orientation for an item. The test project uses this method to assign random orientations.

Note however that changing orientation for an item has a potential impact on all other items (in the same way as moving them) hence a given orientation may not be physically "possible" in a given system.

From an orientation-perspective, another feature I've yet to add is multitouch support to allow an individual item to be rotated interactively. Currently the only way to interactively rotate an item is by holding it and using another item to rotate it with collisions.

Hope that helps!
Dave
By
Markus
9 Aug 2012 13:57
Hey thanks for the fast answer.

With .SetOrientation(UIElement element, double angle)I could control the orientation via for example slider.

Is it possible that you provide the part of the sourcecode from your physics assembly regarding the PhysicViewItem?

I think it should be possible to let PhysicViewItem inherit from Scatterviewitem. SO it should be possible to rotate the container... (e.g. UserControl or Custom Shape in ScatterviewItem).

Maybe I think to naive but the multi touch recognition is handeled by the Scatterviewitem ?

Regards
Markus
By
Jim
30 Aug 2012 21:57
Dave,

Is NUIverse available for download anywhere? Executable and/or source?

Thanks a lot,

Jim
By
Dave
30 Aug 2012 22:44
Not at the moment Jim, but watch this space :)
By
Geoff Le Roux
1 Oct 2012 12:36
Hi Dave

Is it true that the PixelSense table can only pick up BLOB orientations of either 0 or 90 ONLY...? This seems like a massive flaw in the PixelSense table? Finger inputs pick up all orientations but not the Blobs :( Do you know of a way around this...?

Thx
By
Dave
1 Oct 2012 21:06
Hi Geoff, unfortunately this is indeed the case and I agree it is far from ideal. No way 'round it, but an approach half-way between using tags and blobs was described in http://blogs.msdn.com/b/pixelsense/archive/2012/03/22/objecttracking.aspx.
Regards, Dave

Add Comment

*
*
*
Captcha
*
*Required