SETUP‎ > ‎

Essentials

1- ON ALL THE COMPUTERS THAT WILL HANDLE ONE LEAP MOTION
ALL OS(s) *BEFORE*
-1 HAVE THE LEAP MOTION DEVICE DRIVE SETUP (refer to https://leapmotion.com/setup)
-2 Have our release decompressed in "SOMEPATH"
IF WINDOWS
AUTOMATIC NODEJS INSTALLATION (Windows only)
-1 Download our release
-2 Decompress the autosetup.zip file (password is "setup")
-3 Run setup-win/setup.bat
-The folder c:\TCPIGOLO will be deleted if existing and rebuilt.
-Node and Npm will be downloaded and decompressed, npm will be executed to install the websocket module.
-tcpigolo.js and tcpigolo-offline.js will also be copied.
-NOTE: The resulting c:\TCPIGOLO folder will be portable.
-NOTE: To start tcpigolo run "c:\TCPIGOLO\node.exe tcpigolo.js"
(If you move the folder you also have to change the start command, for example "x:\My\Node\is\here\node.exe tcpigolo.js")

MANUAL NODEJS INSTALLATION (Alternative)(for more info refer to https://www.nodejs.org )
-1 On your windows computer crate a folder that will contain your portable nodejs application. NODEFOLDER.
-2 Goto www.nodejs .org  and download the windows standalone executable, save it in NODEFOLDER
-3 Also find "npm.exe" tool  on nodejs.org and save it in NODEFOLDER
-4 Open a terminal and enter
cd "X:\YOUR\PATH\TO\NODEFOLDER"
npm install websockets
-5 From our latest tcpigoleap download, place the tcpigolo-ascii.js and tcpigolo-props.js file inside NODEFOLDER.
-6 run the program
   -start a command prompt as administrator
   -type "cd NODEFOLDER" and press [ENTER], where NODEFOLDER is the fullpath of our nodejs folder.
   -type "node tcpigolo-ascii.js" (or props.js) and press  [ENTER]

IF LINUX (debian)
MANUAL NODEJS INSTALLATION(for more info refer to https://www.nodejs.org )
-1 -download our latest release from our homepage and put tcpigolo-ascii.js and tcpigolo-props.js in some folder " /NODEFOLDER"
-2 open a terminal window
-3 in order insert theese commands
sudo apt-get install nodejs
sudo apt-get install npm
npm install -g node-gyp
npm install websocket
-4 run the program: in a terminal run
node /path/to/your/nodefolder/tcpigolo-ascii.js or props.js
IF MAC
MANUAL NODEJS INSTALLATION (for more info refer to https://www.nodejs.org )
-1 INSTALL nodeJs - base instructions for nodejs in macos , for more www.nodejs.org or This GUIDE
-2 INSTALL required websockets module in nodejs https://github.com/Worlize/WebSocket-Node using
npm install websockets
ALL OS(s) *AFTER*
-Change in tcpigolo.js the MAXHOST ip to [the IP of MAX-PC] or to the broadcast adress of your network.
-Also if you want to connect to an older version of the websocket use, for example, v3 instead of v6 in the very ending of tcpigolo.js.

2 - ON THE COMPUTER RUNNING MAX
-Have sadam.udpreceiver external installed in your max. In max open tcpigola-dict.maxpat or tcpigola-props.maxpat.
-When the patch is LOCKED, double clicking on the tcpigola patch itself will reveal the sada.udpreceiver, if you want to make changes
permanent without using the second inlet.
-As of v0.4 PREVIEW the tcpigola patches can now receive ANY JSON object... if you want to know the real content of the JSON object you are receiving, toggle a message with dump N K in the first inlet and it will dump N packets, one every K (not implemented in v0.4 PREVIEW)

-For the props approach, you should enter the desired props in the props message: how to write them?
Consider that this is what happen before
var LP=JSON.parse(ourreceived data)
And now in js you would acess it's properties like
LP.id or LP.hands[0].id
LP.pointables[1].tipDirection[2]  - If you wanted to get the tip direction Z component  of the second pointable
The our props would be
id or hands[0].id
pointables[1].tipDirection[2]
--Just like js without the LP. before, because it's implicit we are getting data from the parsed object.