GMU:Tutorials/Networking/Explaining the OSCReciever Script from The Captury to Unity: Difference between revisions
No edit summary |
No edit summary |
||
Line 23: | Line 23: | ||
[[File:oscreciever1.png]] | [[File:oscreciever1.png]] | ||
<br> | <br> | ||
=== | ===Step 2=== | ||
Before we go further we have to first set up variables for each coordinate because those will recieve values from the OSCMessage | Before we go further we have to first set up variables for each coordinate because those will recieve values from the OSCMessage | ||
<br> | <br> | ||
Line 31: | Line 31: | ||
[[File:oscreciever2.png]] | [[File:oscreciever2.png]] | ||
<br> | <br> | ||
=== | ===Step 3=== | ||
Here is where we configure the port as mentioned in | Here is where we configure the port as mentioned in Step 1. | ||
<br> | <br> | ||
<br> | <br> | ||
[[File:oscreciever3.png]] | [[File:oscreciever3.png]] | ||
=== | ===Step 4=== | ||
This is our Update Function: | This is our Update Function: | ||
<br> | <br> | ||
Line 47: | Line 47: | ||
<br> | <br> | ||
[[File:oscreciever4.png]] | [[File:oscreciever4.png]] | ||
===Step 5=== | |||
[[File:oscreciever5.png]] | [[File:oscreciever5.png]] |
Revision as of 17:18, 29 June 2016
OSCReciever.js
Explanation
The following script I will provide contains the whole setup you need to recieve data from The Captury and constantly updating it in Unity
Step1
In RemoteIP we set our connection for example to the sever we want to recieve the messages from or we can test it locally:
Local: 127.0.0.1
The Captury: kosmos.medien.uni-weimar.de
SendToPort: is where we type in the UDP Port set in The Captury. Actually it's -- 1065 --
ListenerPort: can be random and should be used in Step 3
The gameReciever variables is where you can drop your 3d object in later. You can define as many as you want.
Step 2
Before we go further we have to first set up variables for each coordinate because those will recieve values from the OSCMessage
For "Person_One" for example we use x1 / y1 / z1
Step 3
Here is where we configure the port as mentioned in Step 1.
Step 4
This is our Update Function:
All values which will be parsed from Step 5 will be constantly updated here.
We can now chose even if we want the objects to be transformed or rotated or whatever.
The Time.frameCount will constantly resubscribe every 60 frames. The first value means the framrate the last one the scale factor.