• Home
  • Products
    • Game Engine
      • Base
      • Mathematics
      • Geometry
      • Physics
      • Particles
      • Animation
      • Graphics
      • Game
      • Game UI
    • Windows Forms
      • Docking Windows
      • Text Editor Control
  • Downloads
  • Buy
    • Overview
    • Professional
    • Indie
    • Non-Commercial
  • Support
    • Overview
    • Blog
    • Forum
    • License FAQ
    • Documentation
  • About
    • About Us
      • Services
    • Contact Us
    • Press
    • Legal Terms
      • Imprint (English)
      • Imprint (German)
Select the search type
 
  • Site
  • Web
Search
DigitalRune.com
Login |Register
NEWS News RSS Feed BLOG Blog RSS Feed FORUM News RSS Feed DOCUMENTATION DigitalRune Software on YouTube DigitalRune Software on Twitter
You are here: SupportForum

If you want to contribute to the forum discussions, please Register or Login.

SearchHome
  • 1
  • 2
  • 3
  • 4
  • 5
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineTransforming Kinect coordinates to Character Model?Transforming Kinect coordinates to Character Model?
Previous
 
Next
New Post
1/3/2012 11:19 AM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Transforming Kinect coordinates to Character Model?  Modified By HelmutG  on 1/3/2012 12:23:54 PM

I have created a small test using the Marionette approach:

http://www.digitalrune.com/Support/Bl...

 
New Post
1/3/2012 11:39 PM
 
nicros
No Ranking

Joined: 12/11/2011
Posts: 6
Re: Transforming Kinect coordinates to Character Model? 

Awesome!   Downloading now... very curious to see what settings you used to control the bounciness.

Also, in working on Approach C described before (letting the ragdoll physics solve the constraints), I am missing something.  I have my actual pose, and target pose (similar to what  you have in the ActiveRagdollSample).  In my Update override, I am calculating the new rotations and applying them to the proper joints (using RotateBoneAbsolute).  When I have calculated all the joints I need, I do Ragdoll.DriveToPose, using the new target pose.

Problem is I see no motion.  I have verified that the target pose is not the same as the actual pose... but still no update.

Thoughts?  And thanks for the marionette sample!

 
New Post
1/4/2012 10:50 AM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Transforming Kinect coordinates to Character Model? 

Some ideas:

Are motors enabled?
Is the motor spring value sufficiently large?
Are the bodies dynamic (not static or kinematic)?

 
New Post
2/13/2012 7:00 AM
 
digitalsummer07
No Ranking

Joined: 2/13/2012
Posts: 21
Re: Transforming Kinect coordinates to Character Model?  Modified By digitalsummer07  on 2/13/2012 8:09:45 AM

Hi,

I've found your "Using Kinect to Animate the XNA Dude in Real-Time" interesting and I would like to purchase for your game engine. However, I just want to make sure that it would work with any other models I used and will have the same functionality with that of the dude-named model.

Thus, I have some questions in mind. Where am I to start changing the model? What are the other things I need to change in the code whenever I have other models replace the dude guy?

Actually I recently tried loading my newly created model and I just replaced the name and directory of the model 

_model = Game.Content.Load("Model\\3DTrialModel"); 

but I got an error saying 

"Cannot find ContentTypeReader for Microsoft.Xna.Framework.Content.Pipeline.Graphics.MaterialContent"

Looking forward to your answers. 

Thank you. 

 
New Post
2/13/2012 9:08 AM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Transforming Kinect coordinates to Character Model? 

Hi,

To replace the Dude model with another model in the KinectAnimationSample:
Add an XNA-compatible model to the content project.
Set the content processor to "Skinned Model Processor (DigitalRune Samples)".
Replace the DudeRagdollCreator class with a class that creates a ragdoll for your custom model. (Defining a ragdoll is currently a manual process. See this article: http://www.digitalrune.com/Support/Bl...)
In the KinectAnimationSample.cs file: Update the hardcoded bone names and scale factor _kinectScale to fit your model. If the skeleton of your model is very different, you might want to modify the marionette joints (e.g. change the MaxForce values or connect them to other skeleton bones).

When you try to load a different model, test the model in a simple XNA sample first to see if XNA can load it. If you can load and draw the model in a XNA sample but not in our samples, please let us know.

You can also try the following: The CharacterAnimationSample included in the DigitalRune Engine contains another test model named "PlayerMarine.fbx". This model works with XNA and with our custom skinned model processors. Try to replace the Dude model in the KinectAnimationSample with the Marine model. If it works with the Marine but not with your custom model, then the problem is probably related to the custom model. If it does not work with the Marine model, then you might miss a step necessary to replace the model.

Hope this helps.

 
New Post
2/13/2012 11:35 AM
 
digitalsummer07
No Ranking

Joined: 2/13/2012
Posts: 21
Re: Transforming Kinect coordinates to Character Model? 

Hi,

Thanks for the immediate reply. I will try to learn it step by step.

However, I still have one problem though, I noticed that when I raised my left hand the dude raised his right hand.

How can I make the Dude mirror my actions? It seems to move the opposite.

Thanks a bunch :)

 
New Post
2/13/2012 1:44 PM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Transforming Kinect coordinates to Character Model? 

The sample simply applies the Kinect data. When the player raises the right hand, the model also raises its right hand. Everything would look ok if the camera was positioned behind the avatar. But since you are facing the avatar, you expect that the game acts like a mirror and the behavior looks odd.

To make the game act like a mirror:

In KinectAnimationSample.cs when you read the kinect joint positions in OnSkeletonFrameReady() mirror them along the x axis:

// Get joint positions.           
for (int i = 0; i < _kinectSkeletonPose.Skeleton.NumberOfBones; i++)
{
  var position = GetKinectJointPosition(skeletonData, i);
   
  // Mirror x values.
  var delta = position - hipCenterPosition;
  delta.X *= -1;
  position = hipCenterPosition + delta;
 
  // Add a hardcoded y-offset to position the skeleton above the ground.
  // And make all joint Z values relative to the hip center.
  position += new Vector3F(0, 1.7f, -hipCenterPosition.Z);
 
  // And store the joint positions in the _kinectSkeletonPose.
  _kinectSkeletonPose.SetBonePoseAbsolute(i, new SrtTransform(QuaternionF.Identity, position))
}

 

In Update() when you update the animation joints, update the left joint using the right kinect bone, and vice versa:

// Update the target positions for the animation joints (using the mirrored bones).
_neckSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.Head).Translation;
_elbowLeftSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.ElbowRight).Translation;
_handLeftSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.HandRight).Translation;
_elbowRightSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.ElbowLeft).Translation;
_handRightSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.HandLeft).Translation;
_kneeLeftSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.KneeRight).Translation;
_ankleLeftSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.AnkleRight).Translation;
_kneeRightSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.KneeLeft).Translation;
_ankleRightSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((int)JointID.AnkleLeft).Translation;

 

I haven't tested this thoroughly. But I think it should work. 

 
New Post
2/14/2012 4:46 AM
 
digitalsummer07
No Ranking

Joined: 2/13/2012
Posts: 21
Re: Transforming Kinect coordinates to Character Model? 

Hi, thanks for the reply.

I already tried the mirroring effect and it worked.. Thank you so much.
I'm currently learning how to add the 3D models in replacement for the Dude.
Hope I can learn that so soon.

Regards.

 
New Post
2/14/2012 5:19 AM
 
digitalsummer07
No Ranking

Joined: 2/13/2012
Posts: 21
Re: Transforming Kinect coordinates to Character Model? 

Hi,

I tried to replace the dude model to my model however at first I got this error:

"Cannot find ContentTypeReader for Microsoft.Xna.Framework.Content.Pipeline.Graphics.MaterialContent."
which points out to this line: _model = Game.Content.Load<Model>("Model\\NewModel");

You said to "Add an XNA-compatible model to the content project", but how can I make sure that an my model is XNA compatible?

I can't proceed to creating my ragdoll class for the model since I'm stuck in this error. I tried to load my model by following this tutorial:

http://msdn.microsoft.com/en-us/libra...  and it loads successfully. However, in the KinectAnimation Sample project. I got an error.

Looking forward to your response.
Thank you.




 
New Post
2/14/2012 11:00 AM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Transforming Kinect coordinates to Character Model? 

To check if a model works with XNA I would first load and render the model as you have already done.
If the model is a skinned, animated character model, I would test it with the AppHub Skinned Model sample (http://create.msdn.com/en-US/educatio...).
If the model does not work in the Skinned Model sample, then I would check the AppHub community forum for help. Exporting a model from a 3D modelling tool with the correct settings that work with the XNA content pipeline can be a bit difficult.

However, if your model works fine in the Skinned Model sample, then the problem must be related to the SkinnedModelProcessor in our KinectAnimationSample. But I currently do not know what could cause the error. You can send the model to us per email (office@digitalrune.com) and we will take a look. (But please check first if the model works in the AppHub Skinned Model sample.)

 
 Page 2 of 6
Previous123...6Next 
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineTransforming Kinect coordinates to Character Model?Transforming Kinect coordinates to Character Model?


DigitalRune is a trademark of Garstenauer Information Technology OG.

Garstenauer Information Technology OG
Weingartenstrasse 35, 4452 Ternberg
Austria (EUROPE)
office@digitalrune.com

Home Products Downloads Buy Support About Us
Game Engine Particles Windows Forms Professional Blog Services
Base Animation Docking Windows Indie Forum Contact Us
Mathematics Graphics Text Editor Control Non-Commercial License FAQ Press (News)
Geometry Game Documentation Legal Terms
Physics Game UI Imprint
Impressum
Copyright © 2006-2012 Garstenauer Information Technology OG Terms Of UsePrivacy Statement