How can I pause the animation,I have a demo for you.Thank you~


hello all

 

i builded 3d model , let rotatetransformed in wpf,and want the animation pause

you download demo :

http://www.jz322.com/wpf3dtest.rar

if can please send email me : tmobile@126.com

 

 

// geometry creation
   mgeometry = new geometrymodel3d(mesh, new diffusematerial(brushes.yellowgreen));
            var tf = new transform3dgroup();
            mgeometry.transform = tf;

            //vector3d v3d = new vector3d(10, 0, 0);
           
            //a = new axisanglerotation3d(v3d, 0);
            //tf.children.add(new rotatetransform3d(a));

            doubleanimation da = new doubleanimation(30, 90, new duration(timespan.fromseconds(10)));
            da.autoreverse = true;

            rotationy.axis = new vector3d(0, 10, 0);

            this.registername("rotationy",rotationy);
            sb = new storyboard();

            storyboard.settargetname(da, "rotationy");
            storyboard.settargetproperty(da, new propertypath(axisanglerotation3d.angleproperty));
            sb.children.add(da);


            group.children.add(mgeometry);

            sb.begin(viewport);

 

 

xaml

 

<modelvisual3d x:name="model">
    <modelvisual3d.content>
     <model3dgroup x:name="group">
      <ambientlight color="darkgray" />
      <directionallight color="white" direction="-5,-5,-7" />
                       
     </model3dgroup>
    </modelvisual3d.content>
                <modelvisual3d.transform>
                    <transform3dgroup>
                        <rotatetransform3d>
                            <rotatetransform3d.rotation>
                                <axisanglerotation3d x:name="rotationy" angle="0" axis="10,0,0" />
                            </rotatetransform3d.rotation>
                        </rotatetransform3d>
                    </transform3dgroup>
                </modelvisual3d.transform>
            </modelvisual3d>

 

 

thank much~~

 

zou

hi zoujiaming,

this silverlight forumn website, if have question wpf, can try post question miscrosoft's wpf forumn :http://social.msdn.microsoft.com/forums/en-us/wpf/threads/



Silverlight  >  Programming Silverlight with .NET – General



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........