{"id":956,"date":"2017-12-01T20:49:25","date_gmt":"2017-12-01T19:49:25","guid":{"rendered":"http:\/\/jmladeno.net\/?p=956"},"modified":"2017-12-28T15:28:35","modified_gmt":"2017-12-28T14:28:35","slug":"tutorial-for-streaming-continuous-data","status":"publish","type":"post","link":"https:\/\/jmladeno.net\/index.php\/2017\/12\/01\/tutorial-for-streaming-continuous-data\/","title":{"rendered":"Send LSL streams from Unity"},"content":{"rendered":"<p><em> <strong>Stream continuous data from Unity<\/strong><\/em><br \/>\n(position, rotation etc.)<br \/>\nTested on Windows machines only<\/p>\n<p>Enter Unity, open your project (example here &#8212; Roll a Ball) and :<\/p>\n<p>1. enter the Scripts folder from the LSL4Unity folder, to access LSL OutletsSR script;<br \/>\n<em>(it is my modification of the original script &#8211; I only added the possibility to choose a Sampling Rate &#8212; between Fixed\/Late Update and Update)<\/em><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/Capture2-1024x563.png\" alt=\"\" width=\"1024\" height=\"563\" class=\"alignleft size-large wp-image-900\" srcset=\"https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/Capture2-1024x563.png 1024w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/Capture2-300x165.png 300w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/Capture2-768x423.png 768w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/Capture2.png 1325w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>2. attach (drag and drop) this script to each game object of interest<br \/>\n(in my case, I like to stream the position of the ball &#8212; Player)<br \/>\n<div id='gallery-1' class='gallery galleryid-956 gallery-columns-2 gallery-size-medium'><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"126\" src=\"https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/PlayerDrag2-300x126.png\" class=\"attachment-medium size-medium\" alt=\"\" aria-describedby=\"gallery-1-1117\" srcset=\"https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/PlayerDrag2-300x126.png 300w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/PlayerDrag2-768x322.png 768w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/PlayerDrag2-1024x430.png 1024w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/PlayerDrag2.png 1306w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n\t\t\t<\/div>\n\t\t\t\t<figcaption class='wp-caption-text gallery-caption' id='gallery-1-1117'>\n\t\t\t\tDrag and Drop Script to game Object of choice\n\t\t\t\t<\/figcaption><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"207\" height=\"300\" src=\"https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/playerDrag-207x300.png\" class=\"attachment-medium size-medium\" alt=\"\" aria-describedby=\"gallery-1-1074\" srcset=\"https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/playerDrag-207x300.png 207w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/playerDrag.png 686w\" sizes=\"auto, (max-width: 207px) 100vw, 207px\" \/>\n\t\t\t<\/div>\n\t\t\t\t<figcaption class='wp-caption-text gallery-caption' id='gallery-1-1074'>\n\t\t\t\tPlayer with LSLTransformSR script\n\t\t\t\t<\/figcaption><\/figure>\n\t\t<\/div>\n<\/p>\n<p>3. When clicking on your gameObj (Player), look at the Inspector,<br \/>\nand add in the Sample Source box the object you wish to stream data from,<br \/>\nby clicking on the circle on the right.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer1-1024x541.jpg\" alt=\"\" width=\"1024\" height=\"541\" class=\"alignleft size-large wp-image-1082\" srcset=\"https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer1-1024x541.jpg 1024w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer1-300x159.jpg 300w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer1-768x406.jpg 768w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer1-1440x761.jpg 1440w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>4. As I want to stream the <em>position<\/em> of my Player (the ball)  and send the stream with a <em>Fixed<\/em> Sampling Rate (so don&#8217;t forget to put <em>Fixed Update<\/em>). <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer2-199x300.png\" alt=\"\" width=\"199\" height=\"300\" class=\"alignleft size-medium wp-image-1083\" srcset=\"https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer2-199x300.png 199w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer2-681x1024.png 681w, https:\/\/jmladeno.net\/wp-content\/uploads\/2017\/12\/InspectorPlayer2.png 686w\" sizes=\"auto, (max-width: 199px) 100vw, 199px\" \/><br \/>\n(I need only to check the position box from the three possible check-boxes)<br \/>\nAlso don&#8217;t forget to give a name and type to your streams.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Stream continuous data from Unity (position, rotation etc.) Tested on Windows machines only Enter Unity, open your project &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":35,"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"predecessor-version":[{"id":1124,"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/posts\/956\/revisions\/1124"}],"wp:attachment":[{"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jmladeno.net\/index.php\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}