.
I want the back side of the mesh as Cyan color , but it is showing black…
What is wrong below, that, back side shading is not working.
But other part of the code is working perfectly.
Could not find any sample on the net.
Best regards
Tahmina
public class TestMeshConduit : Rhino.Display.DisplayConduit
{
public Rhino.Geometry.Mesh Mesh { get; set; }
protected override void CalculateBoundingBox(Rhino.Display.CalculateBoundingBoxEventArgs e)
{
if (null != Mesh)
{
Rhino.Geometry.BoundingBox bbox = Mesh.GetBoundingBox(false);
e.IncludeBoundingBox(bbox);
}
}
protected override void PostDrawObjects(Rhino.Display.DrawEventArgs e)
{
if (null != Mesh)
{
Rhino.Display.DisplayMaterial material = new Rhino.Display.DisplayMaterial();
material.Diffuse = System.Drawing.Color.Blue;
material.BackDiffuse = System.Drawing.Color.Cyan;
e.Display.EnableLighting(true);
e.Display.DrawMeshShaded(Mesh, material);
e.Display.DrawMeshVertices(Mesh, System.Drawing.Color.Red);
e.Display.DrawMeshWires(Mesh, System.Drawing.Color.Black);
}
}
}