/// <summary> /// Constructor /// </summary> public CoverFlowElement(ImageRenderer renderer, int coverPos, int currentPos, ModelVisual3D model) { pos = coverPos; visualModel = model; imageSource = renderer; modelGroup = new Model3DGroup(); modelGroup.Children.Add(new GeometryModel3D(Tessellate(), LoadImage(imageSource.Source))); modelGroup.Children.Add(new GeometryModel3D(TessellateMirror(), LoadImageMirror(imageSource.Source))); rotation = new AxisAngleRotation3D(new Vector3D(0, 1, 0), RotationAngle(currentPos)); translation = new TranslateTransform3D(TranslationX(currentPos), 0, TranslationZ(currentPos)); var transformGroup = new Transform3DGroup(); transformGroup.Children.Add(new RotateTransform3D(rotation)); transformGroup.Children.Add(translation); modelGroup.Transform = transformGroup; Content = modelGroup; visualModel.Children.Add(this); }
public void Add(ImageRenderer renderer) { imageList.Add(imageList.Count, renderer); UpdateRange(index); }