If you want to contribute to the forum discussions, please
I have created a small test using the Marionette approach:
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!
Are motors enabled?
Is the motor spring value sufficiently large?
Are the bodies dynamic (not static or kinematic)?
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.
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.
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 :)
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.
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.
Vector3F(0, 1.7f, -hipCenterPosition.Z);
// And store the joint positions in the _kinectSkeletonPose.
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((
_elbowLeftSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((
_handLeftSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((
_elbowRightSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((
_handRightSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((
_kneeLeftSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((
_ankleLeftSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((
_kneeRightSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((
_ankleRightSpring.AnchorPositionALocal = _kinectSkeletonPose.GetBonePoseAbsolute((
I haven't tested this thoroughly. But I think it should work.
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.
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.
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 (email@example.com) and we will take a look. (But please check first if the model works in the AppHub Skinned Model sample.)