A small program that uses WPF to simulate Windows7 win+tab page transitions, using shortcut keys Ctrl+down or ctrl+up to slide the navigation between the various page elements in the sample program, in this case, using the Viewport2dvisual3d host two-dimensional control, Here for the convenience of example, the two-dimensional control simply uses an image, the following is an interface thumbnail, interested friends can download source code: Http://files.cnblogs.com/5460600/Aero.rar
When you build the three-dimensional scene in this example, you use Viewport3d,perspectivecamera,ambientlight, Viewport2dvisual3d,rotatetransform3d, Translatetransform3d,scaletransform3d and so on, the following is a brief description of what these elements play in the three-dimensional scene, respectively.
1.viewport3d:viewport3d is a 2D visualization element that encapsulates the 3D element's container control in a 2D scenario with two important properties
public Camera Camera { get; set; }
public Visual3DCollection Children { get; }
Camera for the 3D scene specifies where the Observer is located
Children represents the collection class of all 3D child controls for Viewport3D
2.PerspectiveCamera represents a perspective projection camera, which is used in this example to pivot projection of a 3D scene
3.AmbientLight lighting to illuminate 3D scene
4.viewport2dvisual3d renders an interactive 2D control in a 3D scenario, using 6 Viewport2dvisual3d elements in this example to render six images respectively
5.rotatetransform3d applies a rotation to the 3D element, which is used in this example to model transformations of the y-axis 45-degree rotation for Viewport2dvisual3d
6.translatetransform3d applies a translation to the 3D element, which is used in the model transformation of Viewport2dvisual3d x,y,z translations
7.scaletransform3d applies a pull-and-flex to the 3D element, which is used in this example to x,y the tensile model transformation of the Viewport2dvisual3d