有关在屏幕上打印坐标的问题 [英] Question about printing coordinates on the screen

查看:60
本文介绍了有关在屏幕上打印坐标的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我做了一个涉及机器人手臂的项目模仿我右臂的动作。现在我已经启动了一个新的项目文件,并包含了SDK手册指定的所有头文件和.lib。现在我已经制作了包含以下内容的源项目代码文件:

Hi. Am doing a project that involves a robot arm Mimicing my right arm's movement. Right now I have started a new project file and included all the headers and .lib specified by the SDK manual. Now I have made my source project code file that contains:

#include< Windows.h>

#include <Windows.h>

#include< iostream>

#include <iostream>

int main()

int main()

{while(1)

{&NBSP;的std :: COUT<< "hi \ nn";}

{  std::cout<< "hi\n";}

 返回0;

  return 0;

};

以及c的所有标题。

我想做什么现在,获得右肘和右手腕的(x,y,z)位置,并在改变时在无限循环中不断打印在屏幕上。我猜这将涉及从标题中调用函数然后......?

What I want to do for now, is get the (x,y,z) position of right elbow and right wrist and print the on the screen constantly in the infinite loop while changing. I am guessing that this would involve calling functions from the headers and then ...?

我是一个新手,刚开始并抱歉这些愚蠢的问题但对我来说很重要,我管理并做到这一点。我阅读了所提供的所有代码以及说明但仍无法管理。

I am a newbie, just started and sorry for the silly questions but its important to me that i manage and do that. I read all the code provided as well as instructions and still cant manage.

推荐答案

最简单的事情就是让你做类似的事情:

Simplest thing would be for you to do something like:

NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON);
NuiSkeletonTrackingEnable( NULL, 0 );

while(true)
{
    NUI_SKELETON_FRAME SkeletonFrame;
    NuiSkeletonGetNextFrame( 30, &SkeletonFrame );

    for (int i = 0; i < NUI_SKELETON_COUNT; i++)
    {
        NUI_SKELETON_DATA data = SkeletonFrame.SkeletonData[i];
        if (data .eTrackingState == NUI_SKELETON_TRACKED)
        {
            Vector4 rightElbow = data.SkeletonPositions[NUI_SKELETON_POSITION_ELBOW_RIGHT];
            Vector4 rightWrist = data.SkeletonPositions[NUI_SKELETON_POSITION_WRIST_RIGHT];
            
            // Code for doing whatever you want with X,Y,Z positions of right elbow and right wrist
        }
    }
}

NuiShutdown( );

这有意义吗?

Eddy


这篇关于有关在屏幕上打印坐标的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆