Pre loader

How to make an animation for 3d model?

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hello, I am working for making a 3d model animation, but the problem I encounter is class ObjectModel3D has a dependency property named PositionProperty , but it has not a dependency property named XProperty or ZProperty, so I can’t use BeginAnimation or StoryBoard.Begin Class.

for StoryBoard Class, my code is:

_3dObject obj3d = new _3dObject();
         Vector3 vector3 = new Vector3();
         vector3.X = obj3d.ChassisModel.Position.X;

        var animationChassis = new DoubleAnimation()
        {
            From = obj3d.ChassisModel.Position.X,
            To = 100,
            Duration = new Duration(TimeSpan.FromSeconds(1))
        };

        Storyboard storyboard = new Storyboard();
        Storyboard.SetTarget(animationChassis,obj3d.ChassisModel);
        Storyboard.SetTargetProperty(animationChassis,new PropertyPath(ObjectModel3D.PositionProperty));
        storyboard.Children.Add(animationChassis);
        storyboard.Begin();

here Storyboard.SetTargetProperty(animationChassis,new PropertyPath(ObjectModel3D.PositionProperty)); is wrong because ObjectModel3D.PositionProperty can’t be applied.

for BeginAnimation, my code is :

TranslateTransform tt3D = new TranslateTransform();
        _3dObject obj3d = new _3dObject();
         var animationChassis = new DoubleAnimation()
        {
            From = obj3d.ChassisModel.Position.X,
            To = 100,
            Duration = new Duration(TimeSpan.FromSeconds(1))
        };

         obj3d.ChassisModel.RenderTransform = tt3D;

         tt3D.BeginAnimation(TranslateTransform.XProperty,animationChassis);

this code has no error(maybe), but it does nothing. I wanted to use TranslateTransform3D. but obj3d.ChassisModel.RenderTransform don’t correspond to TranslateTransform3D.

Do you have any thoughts about making an animation using ObjectModel3D or any other kind?
Please Help me!
Thanks!!

Update1
I’ve work on this for a whole day, I still didn’t find a way to animate a translation movement of 3d model.
I’m trying to add a dependency property to ObjectModel3D class.
if anyone has any idea, please bring it on.

Update 2
I doubt that ObjectModel3D could be used with DoubleAnimation or StoryBoard.
What I did is take a for loop to manipulate Position.X, and make sure to use second thread to do that.
PS : WPF is a bad platform for 3d model, U3D is better for C# user.

Version
v5.4
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies