XNA坐标和翻译 [英] XNA coordinates and translation

查看:65
本文介绍了XNA坐标和翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在修改avateering示例,我正试图将avatar放在空闲模型中,在方法Draw中使用这段代码(... 。):

I'm modifying avateering example and I'm trying to put avatar in idle model in certain point with this piece of code in method Draw (...) :

//一些代码

void Draw(...,Vector3 startPostion){

void Draw(..., Vector3 startPostion){

//一些代码

  effect.World = Matrix.CreateTranslation(startPosition);

 effect.World = Matrix.CreateTranslation(startPosition);

}

我传递参数startPosition(我从kinect获得,当我距离3m时)这是一些Vector3但我的头像仍然放在(0,0,0)。如果我设置为例如 

I pass argument startPosition (which I got from kinect  when I'm 3m away) which is some Vector3 but my avatar is still placed in (0,0,0). If I set for example 

//我从debbuging effect.world.Translation.X,  effect.world.Translation.Y,  effect.world.Translation.Z实验得到的值,而头像正在移动

// values that I got experimentaly from debbuging effect.world.Translation.X, effect.world.Translation.Y, effect.world.Translation.Z while avatar is moving

effect.World = Matrix.CreateTranslation(posX,posY,posZ)

effect.World = Matrix.CreateTranslation(posX, posY, posZ)

然后上面的行将头像置于该点

then the above line places avatar in that point

这两种方法在设置效果方面有何不同。世界的头像。为什么   effect.world.Translation.X,  effect.world.Translation.Y,  effect.world.Translation.Z采用这个奇怪的坐标? 

What is the difference in these two methods in setting effect.World  of avatar. And why  effect.world.Translation.X, effect.world.Translation.Y, effect.world.Translation.Z take this strange coordinates ? 

推荐答案

Akira有一个很棒的kinect索具程序叫做  KMotion 带有3d头像,用于记录kinect的动作,然后将它们装配到3ds max中的模型。如果我还没有支持blender,我会更新他的代码。

Akira has a nice kinect rigging program called  KMotion with a 3d avatar for recording movements with kinect and then rigging them to a model in 3ds max. I will update his code when I can to support blender if he has not already.


这篇关于XNA坐标和翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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