11-06-2009, 05:35 PM
Thanks for your really quick answer!
What you're saying was my first try but unfortunately the model doesn't animate :S
I Load the model and set the model3dgroup as a content of a modelvisual3D and I place the modelvisual3d into my viewport. And that's ok, I can see my model in the scene but then when I start my animation (in the compositiontarget rendering event with DoAnimate method) And it doesn't work :S.
And as you said I set UseModelTransforms to true before all of this.
What you're saying was my first try but unfortunately the model doesn't animate :S
I Load the model and set the model3dgroup as a content of a modelvisual3D and I place the modelvisual3d into my viewport. And that's ok, I can see my model in the scene but then when I start my animation (in the compositiontarget rendering event with DoAnimate method) And it doesn't work :S.
And as you said I set UseModelTransforms to true before all of this.
Code:
rd = new Reader3ds();
rd.UseModelTransforms = true;
rd.Animator.AutoRepeat = true;
MainModel = new Model3DGroup();
Content = MainModel;
MainModel.Children.Add(rd.ReadFile((Stream)obj));
CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
void CompositionTarget_Rendering(object sender, EventArgs e)
{
rd.Animator.DoAnimate();
}