4
當我玩弄WPF的3D支持時,我想嘗試不同的3D對象材質類型選項,所以起初我創建了一個簡單的場景,只有一個三角形(渲染成功) :用於3D對象的材質
<Viewport3D>
<Viewport3D.Camera>
<PerspectiveCamera Position="-2,2,2" LookDirection="2,-2,-2" UpDirection="0,1,0" />
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight Color="White" Direction="-1,-1,-1" />
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<GeometryModel3D>
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="-1,0,0 0,1,0 1,0,0" TriangleIndices="0,2,1" />
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<DiffuseMaterial Brush="Yellow" />
</GeometryModel3D.Material>
</GeometryModel3D>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
但似乎三角形不再呈現的時候,我改變了GeometryModel3D.Material另一種材料,如
<SpecularMaterial Brush="Yellow" Color="Yellow" SpecularPower="24" />
或
<EmissiveMaterial Brush="Yellow" ></EmissiveMaterial>
這是爲什麼?我應該使用不同的燈光來使鏡面或發光材料起作用嗎?