Color problem in Shaded mode

When I set the color in WireFrame mode, color is set properly. But when
I change to Shaded mode, objects are displayed with mixed colors.
If I set green color, some portion of surface is displayed in green and
other portion of surface is displayed in yellow.
Is it related to Lighting?

m_hContext->SetDisplayMode(hObject, HDISPLAY_MODE_SHADED, bUpdateViewer);

BRepPrimAPI_MakeBox mkBox(gp_Pnt(10, 0, 0), 10.0, 10.0, 10.0);
TopoDS_Shape shape = mkBox.Shape();
Handle(AIS_Shape) hShape = new AIS_Shape(shape);
hCtx->Display(hShape, true);
hCtx->SetColor(hShape, Quantity_Color(0, 1, 0, Quantity_TOC_RGB), true);

Matthias Teich's picture

Did you check if all surfaces are oriented correctly?
I do not know how OpenCascades visualization works, so its just a guess:

In OpenGL you can assign different colors to back-faces and front-faces. OpenCascade uses OpenGL, so maybe this is the problem.