问题描述
我正在修改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 ?
推荐答案
这篇关于XNA坐标和翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!