In WPF 3D programming, it's often desirable to write a class that algorithmically generates triangle meshes for a particular figure, and then to reference that class in XAML. There are basically two ways of doing this, as I describe in Chapter 6 of my new book 3D Programming for Windows . The first way I described a few days ago . The second approach is to derive from ModelVisual3D . This approach is somewhat harder because your class has to define its own Material and BackMaterial properties. The Petzold.Media3D library (available here ) includes an abstract class that derives from ModelVisual3D and provides the necessary overhead, and also several classes that derive from this abstract class. The source code for these classes can be found in the Visuals directory of the Visual Studio project for the library: Object DispatcherObject DependencyObject Visual3D
Read More...