Feed Icon  

Contact

  • Bryant Likes
  • Send mail to the author(s) E-mail
  • twitter
  • View Bryant Likes's profile on LinkedIn
  • del.icio.us
Get Microsoft Silverlight
by clicking "Install Microsoft Silverlight" you accept the
Silverlight license agreement

Hosting By

Hot Topics

Tags

Open Source Projects

Archives

Ads

The WPF/E Gear Keeps Turning

Posted in WPF/E at Thursday, January 25, 2007 9:19 AM Pacific Standard Time

First the SDK team created an article about generating reflections in WPF/E. Then today I read [via Mike Harsh] about Michael Schwarz extending the example to include an animation.  I also read in Mike's post about the WPF/E google group (joined!) and in the group I read Dave Campbell's post about extending the example further to roll the gear across the screen. I couldn't help myself and I took it one step further and gave the rolling motion a little twist so that it looks like the wheel accelerates and hits a wall.

This is done using a SplineDoubleKeyFrame, which allows you change how the keyframe is interpreted. I had no idea how this worked until I came across this post by Karsten where he demonstrates creating bouncing balls in WPF. I borrowed his SplineDoubleKeyFrame but when I applied it to the gear it started fast and then went slow and I wanted it to do the opposite. I didn't understand how the SplineKey worked but came across another post by Karsten where he gives you the code for the Bezier Time which is a WPF app that he wrote to better under stand the effects of the SplineKey. Unfortunately the app was written with one of the beta versions and no longer worked, but I was able to get it running after some rework (although one of the animations is broken still). Using that tool I was able to figure out how to invert the curve and get the effect that I wanted.

The SplineDoubleKeyFrame is definately the way to get the dog ears effect going, now I need to go read up on beziers and splines. :)

Download Gear.xaml

Tuesday, January 30, 2007 5:12:27 AM (Pacific Standard Time, UTC-08:00)
Updated code for the Bezier Time sample is included in the WPF SDK: http://wcpsdk/wpf_samples/html/b9652fd8-ea95-4941-95d5-dfabadd39eaf.htm.
Wednesday, January 31, 2007 2:35:23 AM (Pacific Standard Time, UTC-08:00)
Thanks, but it looks like that link is internal. However, it gave me the info I needed and I downloaded the WPF samples from here:
http://msdn2.microsoft.com/en-us/library/ms771640.aspx
Wednesday, September 26, 2007 11:28:55 PM (Pacific Daylight Time, UTC-07:00)
After making the changes (downloader 2 args) and the js-files I only get a grey screen - no photos or videos that is.

I have re-installed silverlight numerous times and the version is 1.1.etc..

Anyone got tip how to get it right?

Best regards D.
Comments are closed.