{"id":775,"date":"2012-11-28T01:44:38","date_gmt":"2012-11-28T01:44:38","guid":{"rendered":"http:\/\/mclightning.com\/?p=775"},"modified":"2012-11-28T01:44:38","modified_gmt":"2012-11-28T01:44:38","slug":"setting-up-kinect-assisted-java-project-on-eclipse-part-2","status":"publish","type":"post","link":"https:\/\/maximusabrams.com\/?p=775","title":{"rendered":"Setting up Kinect-Assisted Java project in Eclipse &#8211; Part 2"},"content":{"rendered":"<p>In this second article on how to develop kinect assisted applications with java, we will be implementing OpenNI java wrapper into Eclipse and make a simple project for starters.<\/p>\n<p>First add all libraries you use for graphics rendering. Lately I&#8217;m familiar with LibGDX for doing graphics in Java so i will be adding its jar files into my project then i will include them in Java Build Path -&gt; Libraries. Anyway i will not go into detail in this part because everybody has their choice of graphics library.<\/p>\n<p>Now, let&#8217;s show Eclipse where is our Kinect wrappers and native libraries.<br \/>\nIn Eclipse:<br \/>\n1- Click Projects -&gt; Java Build Path -&gt; Libraries<br \/>\n2- Click Add External JARs add select org.OpenNI.jar which is located in &#8220;C:Program FilesOpenNISamplesBinRelease&#8221;<br \/>\n3- Click Arrow button near Jar file we have just added to expand menu.<br \/>\n4- Double-Click on Native library location and select Jar path which is &#8220;C:Program FilesOpenNISamplesBinRelease&#8221;<\/p>\n<p>At this stage, we are done with implementing the wrapper. But we need some sample code to test it , right?<\/p>\n<p><!--more--><\/p>\n<p>Earlier this summer, I started a project to develop a framework to ease kinect assisted development. In git repo of that project I also shared a simplified code for adding skeleton and hand tracking.<\/p>\n<p>Download : <a href=\"http:\/\/github.com\/ayildirim\/bolt\">http:\/\/github.com\/ayildirim\/bolt<\/a><\/p>\n<p>After downloading project<br \/>\n1- Import kinect1 folder as a Java project into eclipse.<br \/>\n2- Click Projects -&gt; Java Build Path -&gt; Projects for your own project (not for the one we just imported)<br \/>\n3- Click Add and select kinect1 which we just imported.<\/p>\n<p>Now, we are done with libraries and classes for basic data acquisition.<br \/>\nYou can even run UserTrackerApplication located in kinect1 project to do some skeleton tracking.<\/p>\n<p><strong>Why did we add kinect1 into our own project if it could have worked alone?<\/strong><br \/>\nWe added it into our own project to use its UserTracker class because it does everything needed to be done for tracking<\/p>\n<p><strong>How I use it in my projects?<\/strong><br \/>\nIn following part of the article I will be referring Create and Render methods, These are both LibGDX methods but all graphic libraries methods similar to these ones.<br \/>\nCreate : is called before scene or window loaded.<br \/>\nRender : is called every frame to render scene or window.<\/p>\n<p>1- Initate each object and variable of UserTracker class in Create method just like it is done in the Main method of UserTrackerApplication.java<br \/>\n2- In Render method I call updateDepth and repaint methods of UserTracker class so it checks for user movements and show them in its own window.<\/p>\n<p>You can check out a kinect assisted game I develop as a contractor earlier this semester.<br \/>\nKinect Assisted Interactive Ad Stand : <a href=\"http:\/\/www.youtube.com\/watch?v=CORwDsC60as\">http:\/\/www.youtube.com\/watch?v=CORwDsC60as<\/a><br \/>\nMe testing the game before : <a href=\"http:\/\/www.youtube.com\/watch?v=_9qrwM2yoEI\">http:\/\/www.youtube.com\/watch?v=_9qrwM2yoEI<\/a><\/p>\n<p>Thank you very much for reading \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this second article on how to develop kinect assisted applications with java, we will be implementing OpenNI java wrapper into Eclipse and make a simple project for starters. First add all libraries you use for graphics rendering. Lately I&#8217;m familiar with LibGDX for doing graphics in Java so i will be adding its jar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8],"tags":[103,121,148,155,158,161,169],"class_list":["post-775","post","type-post","status-publish","format-standard","hentry","category-programming-2","tag-eclipse","tag-game","tag-interactive","tag-java","tag-jframe","tag-kinect","tag-libgdx"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/maximusabrams.com\/index.php?rest_route=\/wp\/v2\/posts\/775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maximusabrams.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maximusabrams.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maximusabrams.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/maximusabrams.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=775"}],"version-history":[{"count":0,"href":"https:\/\/maximusabrams.com\/index.php?rest_route=\/wp\/v2\/posts\/775\/revisions"}],"wp:attachment":[{"href":"https:\/\/maximusabrams.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maximusabrams.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maximusabrams.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}