I have a more advanced example here:

rotation tutorial

hope it helps...[