Opencascade基础教程(14): 一个模型显示问题
如果显示模型时出现如图情况,正对屏幕的平面特别亮,只需要设置材质为非金属就行。
//创建box并显示TopoDS_Shape aShape = BRepPrimAPI_MakeBox(100, 100, 100);Handle(AIS_Shape) aisShpae = new AIS_Shape(aShape);aisShpae->SetDisplayMode(AIS_Shaded);aisShpae->SetColor(Quantity_NOC_RED);//aisShpae->SetMaterial(Graphic3d_NOM_PLASTIC);aisShpae->Attributes()->SetFaceBoundaryDraw(true);aisShpae->Attributes()->SetFaceBoundaryAspect(new Prs3d_LineAspect(Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.));GetAISContext()->Display(aisShpae, true);
// 设置塑料材质后
aisShpae->SetMaterial(Graphic3d_NOM_PLASTIC);