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

Variations in Code and Markup

Although most of the simpler demonstrations of 3D in this book will be done in XAML, you can also do everything in code using your favorite .NET-compliant language. The following program is an enhanced version of Simple3DScene written in C#.

Example 1-2. Simple3DSceneInCode.cs

//---------------------------------------------------- // Simple3DSceneInCode.cs (c) 2007 by Charles Petzold //---------------------------------------------------- using System; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Media; using System.Windows.Media.Media3D; namespace Petzold.Simple3DSceneInCode { public class Simple3DSceneInCode : Window { PerspectiveCamera cam; [STAThread] ...

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