MeshGeometry3D.Normals MeshGeometry3D.Normals MeshGeometry3D.Normals MeshGeometry3D.Normals Property

定義

取得或設定 MeshGeometry3D 的法向量集合。Gets or sets a collection of normal vectors for the MeshGeometry3D.

public:
 property System::Windows::Media::Media3D::Vector3DCollection ^ Normals { System::Windows::Media::Media3D::Vector3DCollection ^ get(); void set(System::Windows::Media::Media3D::Vector3DCollection ^ value); };
public System.Windows.Media.Media3D.Vector3DCollection Normals { get; set; }
member this.Normals : System.Windows.Media.Media3D.Vector3DCollection with get, set
Public Property Normals As Vector3DCollection

屬性值

Vector3DCollection,包含 MeshGeometry3D 的法向量。Vector3DCollection that contains the normal vectors for the MeshGeometry3D.

範例

<GeometryModel3D>
  <GeometryModel3D.Geometry>
          <MeshGeometry3D 
              Positions="-1 -1 0  1 -1 0  -1 1 0  1 1 0"
              Normals="0 0 1  0 0 1  0 0 1  0 0 1"
              TextureCoordinates="0 1  1 1  0 0  1 0   "
              TriangleIndices="0 1 2  1 3 2" />
      </GeometryModel3D.Geometry>
      <GeometryModel3D.Material>
          <DiffuseMaterial>
              <DiffuseMaterial.Brush>
                  <SolidColorBrush Color="Cyan" Opacity="0.3"/>
              </DiffuseMaterial.Brush>
          </DiffuseMaterial>
      </GeometryModel3D.Material>
  <!-- Translate the plane. -->
      <GeometryModel3D.Transform>
          <TranslateTransform3D
            OffsetX="2" OffsetY="0" OffsetZ="-1"   >
          </TranslateTransform3D>
      </GeometryModel3D.Transform>
  </GeometryModel3D>

備註

標準向量是指垂直于定義網格之每個三角形表面的向量。Normal vectors are vectors perpendicular to the face of each triangle that defines a mesh. [法線] 會判斷指定的三角形表面是否已亮起。Normals determine whether a given triangle face is lit.

MeshGeometry3D可讓開發人員指定位置、標準和材質座標資訊。MeshGeometry3D allows the developer to specify position, normal, and texture coordinate information.

法線會假設與網格基本的正面表面相關聯。Normals are assumed to be associated with the front faces of a mesh primitive. 下階順序 (指定用來組成網格之每個三角形的位置的順序) 會決定指定的臉部是否為正面或背面。The winding order (the order in which the Positions that make up each triangle of the mesh are specified) determines whether a given face is front-facing or back-facing.

如果未指定法線, 其產生取決於開發人員是否已指定網格的三角形索引。If normals are not specified, their generation depends on whether the developer has specified triangle indices for the mesh. 如果指定了三角形索引, 將會產生將相鄰臉部納入考慮的法線。If triangle indices are specified, normals will be generated that take into account adjacent faces. 如果未指定三角形索引, 則只會針對指定的三角形產生一個法線。If triangle indices are not specified, only one normal will be generated for the specified triangle. 這可能會導致網格中有多面向的外觀。This might cause a faceted appearance in the mesh.

相依性屬性資訊Dependency Property Information

識別碼欄位Identifier field NormalsProperty
中繼資料屬性設定為trueMetadata properties set to true None

適用於

另請參閱