129
edits
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
**Format: .mov (H.264 Codec) | **Format: .mov (H.264 Codec) | ||
**Resolution: 1920*1280 px | **Resolution: 1920*1280 px | ||
**Length: 10s | **Length: 10s | ||
**Frame Rate: 60 FPS | **Frame Rate: 60 FPS | ||
**Frame: 0~599 | |||
== Use The Data From The Captury In Processing == | |||
Data sending and receiving between the Captury and Processing over a network connection require OSC (Open Sound Control) protocol. The following is the anatomy of OSC in Processing.<br> | |||
<br> | |||
*To build a connection between the Captury and Processing, the listening port and the port of the remote location address need to be same. This could basically any number, and using a 4- or 5-digit number to stay out of the range of most common ports. | |||
<source lang="Java" line start= "18"> | |||
int localport = 12000; | |||
int remoteport = 1065; //Port number the Captury used to send messages | |||
</source> | |||
*Start oscP5, listening for incoming messages at local port. | |||
<source lang="Java" line start= "45"> | |||
osc = new OscP5(this, localport); | |||
</source> | |||
*Remote is a NetAddress, which includes an IP address and a port number. Here it used as parameter to sending OSC messages back to the Capury. | |||
<source lang="Java" line start= "46"> | |||
remote = new NetAddress("kosmos.medien.uni-weimar.de", remoteport); | |||
</source> | |||
<br> | |||
*To receive a value from the Captury, it's necessary to inform Processing the name of the skeleton and the bone. | |||
<source lang="Java" line start= "25"> | |||
String skeleton1 = "LiQianqian"; //Skeleton name same with the Captury | |||
String bone1 = "Root"; //The bone you want to track | |||
</source> | |||
<br> | |||
*To make sure all the bones you want to track always can be called确保更新 | |||
<source lang="Java" line start= "53"> | |||
refreshSubscriptions(); | |||
</source> | |||
<source lang="Java" line start= "58"> | |||
void refreshSubscriptions() { | |||
subscribeBone(skeleton1, bone1); | |||
} | |||
</source> | |||
<source lang="Java" line start= "71"> | |||
if (frameCount % 10 == 0) { | |||
refreshSubscriptions(); | |||
} | |||
</source> | |||
*plug a specific bone | |||
<source lang="Java" line start= "88"> | |||
void plugBone(Object target, String skeleton, String bone) { | |||
String path = "/" + skeleton + "/blender/" + bone + "/vector"; | |||
osc.plug(target, "update" + bone, path); | |||
} | |||
</source> | |||
*capture all OSC events | |||
<source lang="Java" line start= "78"> | |||
void oscEvent(OscMessage msg) { | |||
if(debug) { | |||
print("### received an osc message."); | |||
print(" addrpattern: "+msg.addrPattern()); | |||
println(" typetag: "+msg.typetag()); | |||
} | |||
} | |||
</source> | |||
*objects in space | |||
<source lang="Java" line start= "22"> | |||
Sphere sphere1; | |||
</source> | |||
<source lang="Java" line start= "40"> | |||
sphere1 = new Sphere(1); | |||
</source> | |||
*pass position of Asha's root bone to the first sphere object | |||
<source lang="Java" line start= "50"> | |||
plugBone(sphere1, skeleton1, bone1); | |||
</source> | |||
<source lang="Java"> | |||
class Sphere { | |||
// position of the sphere | |||
float x, y, z; | |||
Sphere( color c) { | |||
this.c = c; | |||
} | |||
// draw the sphere | |||
void draw() { | |||
} | |||
// update the position of the root node | |||
// (this function will be plugged to OSC) | |||
public void updateRoot(float x, float y, float z) { | |||
this.x = map(x, 0, 100, -width/2, width/2); | |||
this.y = map(y, -100, 100, -height/2, height/2); | |||
this.z = map(z, 0, 100, 0, depth);}} | |||
</source> | |||
<source lang="Java"> | |||
</source> | |||
== Play The Video By Processing == | == Play The Video By Processing == |
edits