Bureaucrats, emailconfirmed, Administrators
5,203
edits
No edit summary |
No edit summary |
||
(20 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
!! See functioning Processing [[:File:skeletonTrackingWithCaptury.pde|sketch]] provided by Felix | |||
== Introduction == | == Introduction == | ||
Processing is usually used for the electronic arts, new media art and visual design.<br> | Processing is usually used for the electronic arts, new media art and visual design.<br> | ||
Line 28: | Line 31: | ||
int remoteport = 1065; //Port number the Captury used to send messages | int remoteport = 1065; //Port number the Captury used to send messages | ||
</source> | </source> | ||
[[Image:remotePort.png|thumb|left | [[Image:remotePort.png|thumb|left|Port for the Captury to Send Messages]] | ||
<br style="clear:both"> | <br style="clear:both"> | ||
Line 42: | Line 45: | ||
'''PART 02 – Receive data from the Captury''' | '''PART 02 – Receive data from the Captury''' | ||
*Inform Processing the name of the skeleton and the bone in use. | *Inform Processing the name of the skeleton and the bone in use. Remember to rename your own skeleton to tell the difference from the other. | ||
<source lang="Java" line start= "25"> | <source lang="Java" line start= "25"> | ||
String skeleton1 = "LS"; //Skeleton name same with the Captury | String skeleton1 = "LS"; //Skeleton name same with the Captury | ||
String bone1 = "Root"; //The bone in use | String bone1 = "Root"; //The bone in use | ||
</source> | </source> | ||
[[Image:SkeletonBoneName.png|thumb|left|Name of Skeleton and Bone]] | |||
<br style="clear:both"> | |||
*Incoming OSC messages are forwarded to the oscEvent method and this function runs every time you receive data. Print the Address Pattern and the Typetag of the received OSC messages in the console. | *Incoming OSC messages are forwarded to the oscEvent method and this function runs every time you receive data. Print the Address Pattern and the Typetag of the received OSC messages in the console. | ||
Line 62: | Line 65: | ||
} | } | ||
</source> | </source> | ||
[[Image:DataReceive.png|thumb|left|Data Received in Processing]] | |||
<br style="clear:both"> | |||
*To make sure that all the bones in use are available and refresh them every second or so. And send the message back to the Captury. | *To make sure that all the bones in use are available and refresh them every second or so. And send the message back to the Captury. | ||
Line 86: | Line 90: | ||
} | } | ||
</source> | </source> | ||
[[Image:DataReceive_Capture.png|thumb|left|Data Received in the Captury]] | |||
<br style="clear:both"> | |||
'''PART 03 – Pass data to the object''' | '''PART 03 – Pass data to the object''' | ||
Line 108: | Line 113: | ||
</source> | </source> | ||
*Use plugBone function to pass position data of | *Use plugBone function to pass position data of LS's Root bone to the sphere object | ||
<source lang="Java" line start= "50"> | <source lang="Java" line start= "50"> | ||
plugBone(sphere1, skeleton1, bone1); | plugBone(sphere1, skeleton1, bone1); | ||
Line 120: | Line 125: | ||
*Update the position of the root node. This function will be plugged to OSC. | *Update the position of the root node. This function will be plugged to OSC. | ||
<source lang="Java" line start= " | <source lang="Java" line start= "50"> | ||
public void updateRoot(float x, float y, float z) { | public void updateRoot(float x, float y, float z) { | ||
this.x = map(x, 0, 100, -width/2, width/2); | this.x = map(x, 0, 100, -width/2, width/2); | ||
Line 132: | Line 137: | ||
== Control The Video By Processing == | == Control The Video By Processing == | ||
Since we can successfully use the data from the capture, it can be creatively to use the position of the object to control whatever you want in Processing! <br> | Since we can successfully use the data from the capture, it can be creatively to use the position of the object to control whatever you want in Processing! <br> | ||
The following is an example of using | The following is an example of using position values to play or reverse the video and change the play speed of the video.<br> | ||
This video is about a 3D Chinese Knot tied from loose to tight. The 3D animation is made by 3DS MAX.<br> | |||
<br> | <br> | ||
'''PART 01 – Play a video in Processing''' <br> | '''PART 01 – Play a video in Processing''' <br> | ||
Line 165: | Line 171: | ||
'''PART 02 – Play or reverse the video and change the play speed''' <br> | '''PART 02 – Play or reverse the video and change the play speed''' <br> | ||
*Using position x as the condition. If user stand | *First thing to know is about the relationship between coordinate axis in the Captury and the Performance Platform. Here is the diagram: | ||
*Using position y as the condition. If user stand close to the | [[Image:CapturyAxis.png|thumb|left|Coordinate Axis of the Performance Platform]] | ||
[[Image:CapturyAxis2.png|thumb|left|Diagram]] | |||
<br style="clear:both"> | |||
*Using position x as the condition. If user stand in the center of the platform, the speed will be slowest. The farther away from the center user stand, the faster the movie play. | |||
*Using position y as the condition. If user stand at the side close to the Video Wall, the movie will play as usual, if else the movie will reverse. | |||
<source lang="Java" line start= "4"> | <source lang="Java" line start= "4"> | ||
int play; //Declare a value to judge play or reverse the video | int play; //Declare a value to judge play or reverse the video | ||
Line 187: | Line 198: | ||
*Pay attention that if the movie play to the end, it must be reversed. And if the movie reverse to the beginning, it must play as usual. | *Pay attention that if the movie play to the end, it must be reversed. And if the movie reverse to the beginning, it must play as usual. | ||
<source lang="Java" line start= "26"> | <source lang="Java" line start= "26"> | ||
if( | if(x < -50 && getFrame() < (getLength() - 1)){ | ||
play = 1; | play = 1; | ||
myMovie.play(); | myMovie.play(); | ||
Line 196: | Line 207: | ||
} | } | ||
float newSpeed = map(abs(y)/10, 0, 150, 0*play, 2*play); //abs() to have absolute position value | |||
float newSpeed = map( | |||
myMovie.speed(newSpeed); | myMovie.speed(newSpeed); | ||
</source> | </source> | ||
== Let's Enjoy The Example File== | == Let's Enjoy The Example File == | ||
Thanks for your attention to this tutorial, and feel free to debug and improve it. | Thanks for your attention to this tutorial, and feel free to debug and improve it. | ||
*Here is the complete code for this tutorial uploading on GitHub: [https://github.com/Yunbaby1028/WoolsWorld.git Complete Code of Wool's World]<br> | *Here is the complete code for this tutorial uploading on GitHub: [https://github.com/Yunbaby1028/WoolsWorld.git Complete Code of Wool's World]<br> | ||
*Example File including the movie is shared on Dropbox: [https://www.dropbox.com/sh/f8jcuw03nekoelz/AABeKONtJAI1vfNK4tWSZ3dTa?dl=0 Example File of Wool's World] | *Example File including the movie is shared on Dropbox: [https://www.dropbox.com/sh/f8jcuw03nekoelz/AABeKONtJAI1vfNK4tWSZ3dTa?dl=0 Example File of Wool's World] | ||
== Demonstration == | |||
{{#ev:youtube|https://www.youtube.com/watch?v=dufgDEGYieY|1000|left|Demonstration Video of Controlling the Video in Processing with Captury|frame}} | |||
[https://www.youtube.com/watch?v=dufgDEGYieY Demonstration Video of Controlling the Video in Processing with Captury] |