Surface 2 Physics Download
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:
- Surface Physics Sample (install), .msi (zip'd), 860Kb. The sample application for demonstrating the physics library and layout control.
- Surface Physics Sample (source code), Visual Studio 2010 Project (zip'd), 730Kb. Source code for the the sample application.
- 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
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
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
Is NUIverse available for download anywhere? Executable and/or source?
Thanks a lot,
Jim
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
Regards, Dave
Add Comment