Bryant Likes's Blog

It's all about WebData

Recent Posts

Tags

News


  • Windows Live Alerts
    View Bryant Likes's profile on LinkedIn

    Me

    The posts on this weblog are provided "as is" with no warranties and confer no rights. The opinions expressed herin are the personal opinions of the individual authors and do not represent the views of Avanade in any way.

Community

Email Notifications

Archives

The WPF/E Gear Keeps Turning

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

Posted: 01-25-2007 5:19 PM by bryantlikes | with 6 comment(s)
Filed under:

Comments

Michael's Blog said:

As you may have read on my blog I have added an animation to the gear example from Mike Harsh. Now, the

# January 26, 2007 1:49 AM

m jacobs said:

Updated code for the Bezier Time sample is included in the WPF SDK: http://wcpsdk/wpf_samples/html/b9652fd8-ea95-4941-95d5-dfabadd39eaf.htm.

# January 30, 2007 1:12 PM

bryantlikes said:

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

# January 31, 2007 10:35 AM

Michael's Blog said:

In one of my last posts I wrote about the Silverlight Surface demo of the "photo table". If you had a

# June 4, 2007 5:17 AM

David said:

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.

# September 27, 2007 6:28 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)