Points in Space

A precise location in three-dimensional space is represented by a coordinate point traditionally notated as (X, Y, Z). WPF 3D defines a structure named Point3D that stores one of these coordinate points. The structure has three read/write properties named X, Y, and Z of type double, and a constructor that creates a Point3D object from its X, Y, and Z components.

Here's some C# code to create and initialize a Point3D object:

Point3D point = new Point3D(2.33, 1.5, -2);

In XAML, you represent a Point3D objects as a text string with spaces and/or single commas separating the numbers:

"2.33, 1.5, -2"

I tend to write my Point3D objects with spaces because it looks less cluttered to me:

"2.33 1.5 -2"

Very often, a WPF 3D application must specify ...

Get 3D Programming for Windows® 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.