You can add animations to move the camera’s position, or its zoom say, in exactly the same way and create a “fly past” but to make it look impressive you will need more than a single cube and this is the start of a very big project…
If you would like the code for this project then register and click on CodeBin or you can copy and paste the listing below.
Listing
The complete program is (omitting the usual using statements):
using System.Windows.Media.Media3D; using System.Windows.Media.Animation;namespace Cube1 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } MeshGeometry3D MCube() { MeshGeometry3D cube = new MeshGeometry3D(); Point3DCollection corners = new Point3DCollection(); corners.Add(new Point3D(0.5, 0.5, 0.5)); corners.Add(new Point3D(-0.5, 0.5, 0.5)); corners.Add(new Point3D(-0.5, -0.5, 0.5)); corners.Add(new Point3D(0.5, -0.5, 0.5)); corners.Add(new Point3D(0.5, 0.5, -0.5)); corners.Add(new Point3D(-0.5, 0.5, -0.5)); corners.Add(new Point3D(-0.5, -0.5, -0.5)); corners.Add(new Point3D(0.5, -0.5, -0.5)); cube.Positions = corners;
Routed events are a key feature of WPF. We look at bubbling and tunnelling and how to create your own routed event and how WPF changes the underlying mechanics of Windows.
WPF DataGrid (.NET 4) can be difficult to understand if you aren't used to thinking about objects and collections. This easy to follow introduction explains where the rows and columns have gone. [ ... ]
In the article Custom Bitmap Effects - Getting started we discovered how to work with HLSL in WPF. Now we are in a position to write more sophisticated shaders and this means learning some more [ ... ]
WPF Windows Presentation Foundation is the new way to do forms and all things graphical in .NET. You can still use Windows Forms but don't expect anything particularly new to be added to [ ... ]