XNA coordinates and translation RRS feed

  • Question

  • Hi,

    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 (...) :

    //some code

    void Draw(..., Vector3 startPostion){

    //some code

     effect.World = Matrix.CreateTranslation(startPosition);


    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 

     float posX = -0.84f;
     float posY = -32f;
     float posZ = 95.73f;

    // values that I got experimentaly from debbuging,, while avatar is moving

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

    then the above line places avatar in that point

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

    • Edited by Pedja195 Wednesday, November 7, 2012 10:05 PM
    Wednesday, November 7, 2012 10:04 PM

All replies

  • 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.

    For your question, vectors are what I used for my xna project on the xbox with sunburn engine (I was doing a grenade throw action).   Do you have anymore vectors used that relate to the avatar or other code that could possibly move anything? I seem to remember other methods besides createtranslation.

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog -

    • Edited by The Thinker Thursday, November 15, 2012 12:04 AM
    Wednesday, November 14, 2012 11:54 PM
  • Effectively there is no difference and i just a matter of preference. Manipulating the matrix values are typically not that efficient and you wnat to use the object functions to build the matricies.

    If you are familar with 3D math, the world matrix is the object result of the cameras position type, position and view of the world and where your object is in relation to that. A vector position of 1,1,0 does not equal: 

    1 0 0 0
    0 1 0 0
    0 0 1 0
    0 0 0 1

    after these other factors are calculated.

    You will need to do more research into the XNA frameworks and how these all work. Additionally you might want to look at the XNA forums

    Wednesday, November 28, 2012 11:13 PM