【发布时间】:2015-06-04 20:27:58
【问题描述】:
我正在使用 Arduino、Processing 和 Kinect 编写安装程序。 我想要的是从处理 Kinect 用户的示例代码中获取 SKEL_HEAD 的 x-as。
稍后我想将我头部的 x-as 映射到 180 度伺服电机。
我现在拥有的是,当 Kinect 处于活动状态时,我在头上画了一个红色圆圈。
void drawSkeleton(int userId) {
// to get the 3d joint data
/*
PVector jointPos = new PVector();
context.getJointPositionSkeleton(userId,SimpleOpenNI.SKEL_NECK,jointPos);
println(jointPos);
*/
// Get X position of HEAD
PVector jointPos = new PVector();
context.getJointPositionSkeleton(userId, SimpleOpenNI.SKEL_HEAD, jointPos);
println("jointPos " + jointPos);
PVector jointPos2d = new PVector();
context.convertRealWorldToProjective(jointPos,jointPos2d);
fill(255,0,0); // Fill the shape
ellipse(jointPos2d.x, jointPos2d.y, 40,40); // Create the shape
【问题讨论】:
标签: arduino processing kinect