protected override Motion GetBeforeMotion(int deltaIndex) { double aspect = Owner.ElementWidth / Owner.ElementHeight; double ItemWidth = aspect; double ItemHeight = 1; int row = -1; int column = -1; int slot = Math.Abs(deltaIndex); if (slot <= 2) { row = 0; column = 2 - slot; } else { row = -1 - ((slot - 3) / Columns); column = (slot - 3) % Columns; } Motion m = new Motion(); m.Angle = 0; m.Axis = new Vector3D(1, 0, 0); m.X = (column - 2) * (ItemWidth + Owner.ItemGap); m.Y = -1 * row * (ItemHeight + Owner.ItemGap); return m; }
protected override Motion GetSelectionMotion(int index) { var m = new Motion { Angle = 0, Axis = new Vector3D(0, 1, 0), X = 0, Z = Owner.PopoutDistance }; return m; }
protected override Motion GetAfterMotion(int deltaIndex) { Motion m = new Motion(); m.X = Owner.ItemGap * deltaIndex; m.Z = -1 * Owner.ItemGap * deltaIndex; return m; }
protected override Motion GetSelectionMotion() { Motion m = new Motion(); m.Axis = new Vector3D(0, 1, 0); m.Z = Owner.PopoutDistance; return m; }
protected override Motion GetPreviousMotion(int index) { Motion m = new Motion(); m.X = -1*Owner.FrontItemGap; m.Z = -1*Owner.ItemGap*(Owner.SelectedIndex - index); return m; }
protected override Motion GetAfterMotion(int deltaIndex) { Motion m = new Motion(); m.X = -1 * Owner.FrontItemGap; m.Z = -1 * Owner.ItemGap * deltaIndex + Owner.PopoutDistance * 2 / 3; return m; }
protected override Motion GetBeforeMotion(int deltaIndex) { Motion m = new Motion(); m.X = -1 * Owner.FrontItemGap; m.Z = Owner.ItemGap * deltaIndex; return m; }
protected override Motion GetSelectionMotion() { Motion m = new Motion(); m.X = -1 * (Owner.ItemGap + Owner.PopoutDistance); m.Y = Owner.ItemGap; return m; }
protected override Motion GetNextMotion(int index) { Motion m = new Motion(); m.X = -1*Owner.FrontItemGap; m.Z = Owner.ItemGap*(index - Owner.SelectedIndex); return m; }
protected override Motion GetSelectionMotion(int index) { Motion m = new Motion(); m.Angle = 0; m.Y = 0; m.Z = Owner.PopoutDistance; return m; }
protected override Motion GetPreviousMotion(int index) { Motion m = new Motion(); m.Angle = Owner.TiltAngle; m.Axis = new Vector3D(1, 0, 0); m.Y = -1*Owner.ItemGap*(Owner.SelectedIndex - index) - Owner.FrontItemGap; return m; }
protected override Motion GetAfterMotion(int deltaIndex) { Motion m = new Motion(); m.Angle = -1 * Owner.TiltAngle; m.Axis = new Vector3D(0, 1, 0); m.X = Owner.ItemGap * deltaIndex + Owner.FrontItemGap; return m; }
protected override Motion GetBeforeMotion(int deltaIndex) { Motion m = new Motion(); m.Angle = Owner.TiltAngle; m.Axis = new Vector3D(1, 0, 0); m.Y = Owner.ItemGap * deltaIndex - Owner.FrontItemGap; return m; }
protected override Motion GetNextMotion(int index) { Motion m = new Motion(); m.Angle = -1*Owner.TiltAngle; m.Axis = new Vector3D(0, 1, 0); m.X = Owner.ItemGap*(index - Owner.SelectedIndex) + Owner.FrontItemGap; return m; }
protected override Motion GetPreviousMotion(int index) { Motion m = new Motion(); m.Axis = new Vector3D(0, 1, 0); m.X = -1*(Owner.FrontItemGap + Owner.ItemGap*(Owner.SelectedIndex - index)); m.Z = -1*Owner.ItemGap*(Owner.SelectedIndex - index); return m; }
protected override Motion GetBeforeMotion(int deltaIndex) { Motion m = new Motion(); m.Axis = new Vector3D(0, 1, 0); m.X = Owner.FrontItemGap + Owner.ItemGap * deltaIndex; m.Z = Owner.ItemGap * deltaIndex; return m; }
protected override Motion GetSelectionMotion() { Motion m = new Motion(); m.Angle = -1 * 45; m.Axis = new Vector3D(0, 0, 1); m.X = 2 * Owner.ItemGap; return m; }
protected override Motion GetNextMotion(int index) { var m = new Motion { Angle = -1*Owner.TiltAngle, Axis = new Vector3D(0, 1, 0), X = Owner.ItemGap*(index - Owner.GetPositionIndex(Owner.SelectedIndex)) + Owner.FrontItemGap }; return m; }
protected override Motion GetSelectionMotion() { Motion m = new Motion(); m.Angle = 0; m.Axis = new Vector3D(0, 0, 1); m.X = 0; //Owner.FrontItemGap; m.Z = Owner.PopoutDistance; return m; }
protected override Motion GetSelectionMotion() { double angle = Math.PI/2; Motion m = new Motion(); m.X = Radius*Math.Cos(angle); m.Z = Owner.PopoutDistance + Radius*Math.Sin(angle); m.Y = 0; m.Axis = new Vector3D(0, 1, 0); return m; }
protected override Motion GetSelectionMotion() { Motion m = new Motion(); m.Angle = -45; m.Axis = new Vector3D(1, 0, 0); m.X = 0; m.Y = Owner.PopoutDistance; return m; }
protected override Motion GetBeforeMotion(int deltaIndex) { double angle = Math.PI/2 + UnitAngle*deltaIndex; Motion m = new Motion(); m.X = -Radius*Math.Cos(angle); m.Z = -1*Owner.FrontItemGap + Radius*Math.Sin(angle); m.Y = 0; m.Angle = Owner.TiltAngle; m.Axis = new Vector3D(0, 1, 0); return m; }
protected override Motion GetBeforeMotion(int deltaIndex) { Motion m = new Motion(); m.Angle = Owner.TiltAngle; m.Axis = new Vector3D(0, 0, 1); m.X = Owner.ItemGap * deltaIndex; m.Y = Owner.ItemGap * deltaIndex; m.Z = Owner.ItemGap * deltaIndex; return m; }
private void PrepareStoryboard(Storyboard sb, Motion motion) { // Child animations AxisAngleRotation3D rotation = (sb.Children[0] as Rotation3DAnimation).To as AxisAngleRotation3D; DoubleAnimation xAnim = sb.Children[1] as DoubleAnimation; DoubleAnimation yAnim = sb.Children[2] as DoubleAnimation; DoubleAnimation zAnim = sb.Children[3] as DoubleAnimation; rotation.Angle = motion.Angle; rotation.Axis = motion.Axis; xAnim.To = motion.X; yAnim.To = motion.Y; zAnim.To = motion.Z; }
private static void PrepareStoryboard(Storyboard sb, Motion motion) { // Child animations var rotation = ((Rotation3DAnimation) sb.Children[0]).To as AxisAngleRotation3D; var xAnim = sb.Children[1] as DoubleAnimation; var yAnim = sb.Children[2] as DoubleAnimation; var zAnim = sb.Children[3] as DoubleAnimation; if (rotation != null) { rotation.Angle = motion.Angle; rotation.Axis = motion.Axis; } if (xAnim != null) xAnim.To = motion.X; if (yAnim != null) yAnim.To = motion.Y; if (zAnim != null) zAnim.To = motion.Z; }