Showing and Hiding objects
#5
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:
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!
  


Messages In This Thread
Showing and Hiding objects - by riacosta - 11-06-2009, 03:30 PM
RE: Showing and Hiding objects - by abenedik - 11-06-2009, 04:02 PM
RE: Showing and Hiding objects - by riacosta - 11-06-2009, 05:35 PM
RE: Showing and Hiding objects - by abenedik - 11-06-2009, 07:06 PM
RE: Showing and Hiding objects - by riacosta - 11-10-2009, 12:31 PM
RE: Showing and Hiding objects - by riacosta - 11-10-2009, 06:08 PM
RE: Showing and Hiding objects - by abenedik - 11-11-2009, 11:40 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)