I’m not sure what the difference is. If you have any references or explanations, please let me know.
Hello @mini,
The functions SetFrontFaceColor and SetBackFaceColor allow you to specify separate colors for the two sides of a shell. Since polygon handedness and culling determine how the front and back faces are rendered, ensure that you have set those parameters appropriately. Below is a sample code:
void CHPSView::OnUserCode2()
{
SegmentKey model_key = GetCanvas().GetAttachedLayout().GetAttachedView().GetAttachedModel().GetSegmentKey();
SegmentKey quad_key = model_key.Subsegment("quad");
quad_key.GetDrawingAttributeControl().SetPolygonHandedness(HPS::Drawing::Handedness::Right);
quad_key.GetCullingControl().SetBackFace(false);
quad_key.GetMaterialMappingControl().SetFrontFaceColor(HPS::RGBAColor(1, 0, 0)); //set front face color to red
quad_key.GetMaterialMappingControl().SetBackFaceColor(HPS::RGBAColor(0, 1, 0)); //set back face color to green
Point points[4] = { Point(-0.5, -0.5, 0), Point(0.5, -0.5, 0), Point(0.5, 0.5, 0), Point(-0.5, 0.5, 0) };
int faceList[5] = { 4, 0, 1, 2, 3 };
quad_key.InsertShell(4, points, 5, faceList);
_canvas.UpdateWithNotifier().Wait();
}
Here is the result:
Thanks,
Tino