tBeta -> flosc -> Unity - javascript
Posted: 14 August 2009 04:59 AM   [ Ignore ]
Avatar
Rank
Joined  2009-04-08
Total Posts:  8
New Member

Here is a script utility that i made for catching tuio msg from flosc in Unity:

import System.IO
import System.Text
import System.Net.Sockets


var 
XmlData String "";

var 
ms float 0.1;
var 
Updatedboolean false;
private var 
client TcpClient
private var 
parser TuioParser;

private var 
stream NetworkStream;

function 
Start()
    client 
= new TcpClient(); 
    
client.Connect("127.0.0.1"3000);
    
InvokeRepeating"GetStream"0.5ms ); 
    
stream client.GetStream();
    
parser = new TuioParser();
    
 


function OnApplicationQuit()
    EndStream
();
}

function EndStream() {
    stream
.Close();
    
client.Close();
}


function GetStream () 
    
var data byte[];
    
data = new byte[client.ReceiveBufferSize];
    try 
{
        
var Int32 int stream.Read(data0data.length);
        
XmlData System.Text.Encoding.get_ASCII().GetString(data,0,Int32);
        
parser.XmlStringToTrackedDataList(XmlData);
        
Updated true;
    
}
    
catch(e{
        Debug
.Log(e);
    
}
}

function getTrackedItemList() : TrackedData[] {
    Updated 
false;
    return(
parser.getTrackedDataList());
}

TuioParser & TrackedData are some custom class for parsing xml from flosc.
EDIT: Mostly, this script is for showing how to use Mono library(.Net) with unity3d and flosc

Profile
 
 
Posted: 18 October 2010 10:45 AM   [ Ignore ]   [ # 1 ]
Rank
Joined  2010-10-15
Total Posts:  2
New Member

I have not started building my DI table yet and I am a total newbee at multitouch and all apps here, but I do have previous experience in unity3d.
I love support for multitouch in unity, it brings up loads of possibilities. smile

Profile
 
 
Posted: 18 October 2010 10:04 PM   [ Ignore ]   [ # 2 ]
Rank
Joined  2010-08-25
Total Posts:  21
New Member

Correct me if I’m wrong but I thought TUIO used UDP instead of TCP.

Profile
 
 
Posted: 09 November 2010 03:30 PM   [ Ignore ]   [ # 3 ]
Avatar
Rank
Joined  2009-01-01
Total Posts:  16
New Member

does unity3D have an abstract API? We are doing a 3D model stereoscopy study. Considering if unity should be what we can go for.

 Signature 

We do the rest

http://breakfastny.com/

Profile