11-10-2009, 12:31 PM
Hi and thanks again for your quick reply!
Unfortunately I'm not using an imported camera, I'm using a normal perspectivecamera defined in XAML.
My animation consists in many objects moving by inverse kinematics (It's a robot caracter moving and doing things :-) )
The animation works perfectly when I use the ReadFile(file,viewport) but, as I told you, I need to hide and show these caracters in the scene(due to app performance) so I need to use readfile(file) as you said.
My structure is something like this:
and then I instance this class in my mainpage and get it into my viewport:
With this method I can hide and show my objects but they don't animate :S Am I doing something wrong? Thanks again and sorry for all of these silly questions!
Unfortunately I'm not using an imported camera, I'm using a normal perspectivecamera defined in XAML.
My animation consists in many objects moving by inverse kinematics (It's a robot caracter moving and doing things :-) )
The animation works perfectly when I use the ReadFile(file,viewport) but, as I told you, I need to hide and show these caracters in the scene(due to app performance) so I need to use readfile(file) as you said.
My structure is something like this:
Code:
public class RobotModel3D : ModelVisual3D
{
Reader3ds rd;
public RobotModel3D()
{
rd = new Reader3ds();
rd.UseModelTransforms = true;
Content = (rd.ReadFile((Stream)obj));
CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
}
void CompositionTarget_Rendering(object sender, EventArgs e)
{
rd.Animator.DoAnimate();
rd.RootModel3DGroup.Transform = this.Transform;
}
}and then I instance this class in my mainpage and get it into my viewport:
Code:
RobotModel3D r = new RobotModel3D();
viewport.Children.Add(r);With this method I can hide and show my objects but they don't animate :S Am I doing something wrong? Thanks again and sorry for all of these silly questions!

