Unity3d on Microsoft Surface unit

Hello Community!

I got unity to run on an Microsoft Surface unit and interact with the tuch input. Here is video for proof:

The way I did it:

  1. Created windows form application in c# and import the Surface dlls. When application is lunched send a signal to the surface to say: “I am working, and I have loaded”.

  2. Create an AxUnityWebPlayerControl (or what it´s called) and place this on the winform.

  3. In unity when the application is loaded send an external call to winform application to say “I´m loaded now”.

  4. Place an invisible control over the UnityControl.

  5. Take the handle from this control and send this to Surface API and say: “use this handle for the input”.

  6. Add inputevents.

  7. Set up an Tcp/Ip connection to the unity application.

  8. On input events, send the input data over Tcp/Ip to the unity application.


Two questions:

  1. Is there an easier way to do this?

  2. Is there some way I can integrate the Unity Web Player in the form application so the user don´t have to install the Unity Web Player to run my application.

Best regards,
Johan

Nothing you can do about the user having to install the unity3d run-time package… at least, not as far as I know.

Couldn’t you send the events to the ActiveX control, trough invoking methods?

I’ve never tried it myself, but I know you can invoke methods of an ActiveX control, so perhaps that’s something you can do…

I’m also checking this to use it inside where I work.
Do you know if we can get more than 5 touchs with this method? Because so far, I think Unity can only handle 5 touches.

Nice go in there :wink:

No, Tcp/Ip work alot better. Also the contacts that I send seems to be a bit too big to be sent through invoking members in the ActiveX control.

Yes, basicly unlimited amount of contacts (touches).

Swedes, I take it? Good work, either way.

Thank you,

I´m from Sweden, yes :), you can hear me talk swedish in the video, also my horrible written english would be a dead give away. :slight_smile:

Very awesome!

Excellent work!

I don’t suppose you’d be willing to post your code?

Hi, we’re a group of french student developing a game on unity designed for Microsoft Surface.
Unfortunately we encounter some difficulties to port the game to the platform.
As a consequence, we would like to have more precisions about this specific method. If the author or anyone that succeeded to reproduce it could answer, that would be great.

  1. Which specific Surface DLLs do you need to import ?
  2. How do you create AxUnityWebPlayerControl ?

We’ve already been looking all over google for this… Thank you very much!

surface requires following dll’s

  1. Microsoft.Surface.dll
  2. Microsoft.Surface. Presentation.dll
  3. Microsoft.Surface.Core.dll
  4. Microsoft.Surface.Presentation.Generic.dll
  5. Microsoft.Surface.Presentation.Design.dll
    :sunglasses::slight_smile:

There are so many possibilities for cool unity apps with MSS. Can’t wait till ours is fully developed :slight_smile: https://vimeo.com/21981514

What do you mean in the first step when you say “send a signal to the surface to say: ‘I am working, and I have loaded’.”?

In the Surface API you have the “load” or “initialzie” function (dont remember exactly, this was 2 years ago). In the end of that function you will notice in the examples that you send a call to the Surface API. That call.