Getting Started with 3D Graphics
The purpose of 3D graphics is to produce 2D images from 3D models suitable for displaying on a screen. Creating images from 3D models is a different paradigm than most 2D developers are used to. When working in two dimensions, you usually draw the exact shape that you want, using absolute coordinates. If you want a rectangle at (50,75) that is 100 units wide by 30 units tall, you typically create a Rectangle
element (or a GeometryDrawing
with a RectangleGeometry
that has the corresponding bounds). Consider the house drawn in Listing 8.1 using the 2D Drawing
classes in WPF. Figure 8.1 shows the output.
<Page Background="Black" xmlns
Get XAML Unleashed 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.