I'm developing a form in WPF with the technique of Parallax Scrolling and I need to work out one last step. I wish recreate this nice effect of the mouse.
I'm trying to get the cool delayed easing when the mouse finishes moving. When the mouse finishes moving, the background slowly stops moving a bit later, which is easily achievable via the easing of points, but I don't have a clear idea on how do it.
I created 3 backgrounds and when the mouse moves, I recreate Parallax Scrolling. Now I wish add this feature to make it all more realistic.
Do you have any idea how I can recreate this effect of the mouse?
EDIT
I list my code snippet to show you how I move the 3 backgrounds when the mouse move event:
private void Window_MouseMove(object sender, MouseEventArgs e)//it is the Layout Root that contain the 3 layouts to create the parallax effect
{
Point mouse = e.GetPosition(this);
TransformGroup group = (TransformGroup)this.grid.RenderTransform; //The first Background
TranslateTransform translate = (TranslateTransform)group.Children[3];
translate.X = 400 - mouse.X ;
translate.Y = 300 - mouse.Y;
TransformGroup group1 = (TransformGroup)this.grid1.RenderTransform;// 2th Background
TranslateTransform translate1 = (TranslateTransform)group1.Children[3];
translate1.X = 400 - (mouse.X - 10) * 2;
translate1.Y = 300 - (mouse.Y - 10) * 2;
TransformGroup group2 = (TransformGroup)this.grid2.RenderTransform;// 3th Background
TranslateTransform translate2 = (TranslateTransform)group2.Children[3];
translate2.X = 400 - (mouse.X - 20) * 3;
translate2.Y = 300 - (mouse.Y - 20) * 3;
}
Maybe that can make you understand my question better.