27.1. 3-D Drawing Basics

A 3-D drawing in WPF involves four ingredients:

  • A viewport, which hosts your 3-D content

  • A 3-D object

  • A light source that illuminates part or all of your 3-D scene

  • A camera, which provides the vantage point from which you view the 3-D scene

Of course, more complex 3-D scenes will feature multiple objects and may include multiple light sources. (It's also possible to create a 3-D object that doesn't require a light source, if the 3-D object itself gives off light.) However, these basic ingredients provide a good starting point.

Compared to 2-D graphics, it's the second and third points that really make a difference. Programmers who are new to 3-D programming sometimes assume that 3-D libraries are just a simpler way to create ...

Get Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.