Best approach to physics animation in Silverlight?

I am new to Silverlight and want to revive a ball that is fired from a cannon and then moves through the air according to the laws of physics (so rude, along an elliptical path).

My tendency is to use a callback timer and move the small ball every 50 ms by changing its Canvas.LeftProperty and Canvas.TopProperty values. Is this the right approach or should I use DoubleAnimation? My resistance to using animations here is that I would have to create many different animations in a row.

Which way will the Silverlight guru take?

+3
source share
3 answers

, . silverlight, . , .

, , , X Y.

Game Physics 101 .

+2

, , libraray

+2

, . .

Y ( ), ( , ). ( 9,8 //), Y ( ​​) , , .

X , .

, :

  • (, )
  • .

, Y , .

X .

Of course, it will include nontrivial math to determine the exact numbers to enter in AccelerationRatio , DecelerationRatio , SpeedRatio , Duration , From, and To . But you have to work, no matter what method you use.

+1
source

Source: https://habr.com/ru/post/1721649/


All Articles