Materials for 3D objects

As I played with WPF 3D support, I wanted to try different options for the types of materials of three-dimensional objects, so first I created a simple scene with just a triangle (which displays in order):

<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> 

But it seems that the triangle is no longer displayed when I changed GeometryModel3D.Material to another material, for example

 <SpecularMaterial Brush="Yellow" Color="Yellow" SpecularPower="24" /> 

or

 <EmissiveMaterial Brush="Yellow" ></EmissiveMaterial> 

Why? Should different light sources be used for mirror or emitting materials?

+4
source share
1 answer

Emission material does not work on its own; use it in combination with other materials. For instance:

 <GeometryModel3D.Material> <MaterialGroup> <DiffuseMaterial Brush="Black"></DiffuseMaterial> <EmissiveMaterial Brush="Yellow" ></EmissiveMaterial> </MaterialGroup> </GeometryModel3D.Material> 
+5
source

Source: https://habr.com/ru/post/1344910/


All Articles