PETZOLD BOOK BLOG

Charles Petzold on writing books, reading books, and exercising the internal UTM


Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

The Tiniest 3D Program

January 19, 2007
Roscoe, NY

This, I believe, is the world's tiniest functional WPF 3D program:

This XAML file achieves its "tiniest" status in several ways. It defines only a single triangle, but includes only the Positions property and relies on an automatically-generated TriangleIndices property containing the indicies 0, 1, and 2. It does not include a light source, which means the triangle won't have any color and will be displayed as black regardless of the Material setting. Finally, it relies upon the defaults for PerspectiveCamera, which place the camera at the origin looking staight back along the negative Z axis.


Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

(c) Copyright Charles Petzold
www.charlespetzold.com