I am glad that you like my importer.
I think I understand your problem.
You are using the Animator class in Reader3ds to animate the read objects. You have used the Read method with MyViewPort3D parameter so the animator can automatically refresh the models.
But you can also do the animation without specifying the MyViewPort3D in the Read method. The trick is to set UseModelTransforms in Reader3ds to true before reading the 3ds file - this also improves the performance of the animation.
For example with the following XAML:
... you can use the following code:
// seting UseModelTransforms to true will just update the transformations on the model when animating
reader3ds.UseModelTransforms = true;
Model3DGroup readModel = reader3ds.ReadFile((Stream)obj);
// Add the read 3d model into custom MainModelGroup
// Don't forget to set the camera if it is defined in 3ds
MyViewPort3D.Camera = _reader3ds.Cameras;
... add the code to start the animation - the models will be updated automatically
Now when you want you can simply clear the MainModelGroup.Children to hide the models.
If you do not set the UseModelTransforms to true, than for each animation frame a completely new Model3DGroup is created. It is also possible to use Animator with this mode. Here use the Model3DGroup that is returned from each DoAnimate method and use it to replace the current content of the MainModelGroup.
I hope this will help you.
To make the Reader3ds even more powerful, try also the Ab3d.PowerToys (see more: http://www.ab4d.com/PowerToys.aspx
). With the Ab3d.PowerToys the programming with WPF 3D will be even easier. It contains improved cameras, mouse camera controllers, simplified events management, base 3d objects and 3d lines support.
(11-06-2009, 03:30 PM)riacosta Wrote: Hi!
We just bought the library professional version and I´d like to say that it`s a fantastic work! Congrats!
But We have a tiny problem showing and hiding objects in the scene.
When I add and ojb to my scene (reader3ds.ReadFile((Stream)obj, MyViewPort3D)) There's no way to hide the object or take it out from the visualtree because when I'm animationg the object I can not manage my own visualtree in the Viewport3D :S
Is there any good solution for this? Because I don't really want to reinstance and reload the whole object :S What is really bad for the performance.
thanks! and great job again!