O'Reilly logo

3D Programming for Windows® by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deriving from ModelVisual3D

In the entire System.Windows.Media.Media3D namespace, only one class is neither abstract nor sealed. That class is ModelVisual3D, and you might be wondering: What happened? Did they just forget to add the sealed modifier?

No, ModelVisual3D was deliberately made available for inheritance. The problem is that it's not that easy to do so, and has a certain built-in hassle factor.

As you'll recall, ModelVisual3D defines three properties: Children, Content, and Transform. When you use ModelVisual3D for three-dimensional figures, you set the Content property to an object of type GeometryModel3D, which defines the Geometry, Material, and BackMaterial properties that define the figure.

The implication here is simple: If you derive ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required