Skip to content

Commit

Permalink
Update 3-d-graphics-overview.md (#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
adegeo authored Nov 1, 2023
1 parent f576a86 commit 9538087
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Perspective and Orthographic Projections

[!code-xaml[basic3d#Basic3DXAML3DN3](~/samples/snippets/xaml/VS_Snippets_Wpf/Basic3D/XAML/Window1.xaml#basic3dxaml3dn3)]

In the preceding example, the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Positions%2A> list specifies four vertices to define a rectangle mesh. The <xref:System.Windows.Media.Media3D.MeshGeometry3D.TriangleIndices%2A> property specifies a list of two groups of three indices. Each number in the list refers to an offset into the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Positions%2A> list. For example, the first three vertices specified by the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Positions%2A> list are (-1,-1,0), (1,-1,0), and (-1,1,0). The first three indices specified by the <xref:System.Windows.Media.Media3D.MeshGeometry3D.TriangleIndices%2A> list are 0, 1, and 2, which correspond to the first, second, and third points in the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Positions%2A> list. As a result, the first triangle that makes up the rectangle model will be composed from (-1,-1,0) to (1,-1,0) to (-1,1,0), and the second triangle will be determined similarly.
In the preceding example, the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Positions%2A> list specifies four vertices to define a rectangle mesh. The <xref:System.Windows.Media.Media3D.MeshGeometry3D.TriangleIndices%2A> property specifies a list of two groups of three indices. Each number in the list refers to an offset into the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Positions%2A> list. For example, the first three vertices specified by the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Positions%2A> list are :::no-loc text="(-1,-1,0)":::, :::no-loc text="(1,-1,0)":::, and :::no-loc text="(-1,1,0)":::. The first three indices specified by the <xref:System.Windows.Media.Media3D.MeshGeometry3D.TriangleIndices%2A> list are 0, 1, and 2, which correspond to the first, second, and third points in the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Positions%2A> list. As a result, the first triangle that makes up the rectangle model will be composed from :::no-loc text="(-1,-1,0)"::: to :::no-loc text="(1,-1,0)"::: to :::no-loc text="(-1,1,0)":::, and the second triangle will be determined similarly.

You can continue defining the model by specifying values for the <xref:System.Windows.Media.Media3D.MeshGeometry3D.Normals%2A> and <xref:System.Windows.Media.Media3D.MeshGeometry3D.TextureCoordinates%2A> properties. To render the surface of the model, the graphics system needs information about which direction the surface is facing at any given triangle. It uses this information to make lighting calculations for the model: surfaces that face directly towards a light source appear brighter than those angled away from the light. Though the WPF can determine default normal vectors by using the position coordinates, you can also specify different normal vectors to approximate the appearance of curved surfaces.

Expand Down

0 comments on commit 9538087

Please sign in to comment.