I try to represent color shading on a mesh from the different vertex colors. I know that with OpenGL, it is easily obtained with the function glShadeModel(GL_SMOOTH), but it's a little bit harder with OpenCascade.
Until now, I created a Graphic3d_Group in which I placed some Graphic3d_VertexC in order to display a triangle via the method TriangleSet, but I still not have the shading.
I saw that the abstract class V3d_View has a method called SetShadingModel and that we could use the V3d_MULTICOLOR option. But I don't succeed with it. I don't know how to use this method (or if it's the right method to use).
Thank you for your help
static Graphic3d_Array1OfVertexC verticesC( 1, 3);
static Aspect_Array1OfEdge mesEdges(1,3);
Handle(Graphic3d_AspectLine3d) myLineAspect = new Graphic3d_AspectLine3d();
Handle(Graphic3d_AspectFillArea3d) myFillAspect = (new Prs3d_ShadingAspect())->Aspect();
Handle( Graphic3d_Group ) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
verticesC(1) = Graphic3d_VertexC(0,0,0,Quantity_Color(Quantity_NOC_BLUE1)) ;
verticesC(2) = Graphic3d_VertexC(100,0,0,Quantity_Color(Quantity_NOC_RED)) ; ;
verticesC(3) = Graphic3d_VertexC(100,100,0,Quantity_Color(Quantity_NOC_YELLOW)) ; ;
mesEdges(1) = Aspect_Edge(1,2,Aspect_TOE_VISIBLE);
mesEdges(2) = Aspect_Edge(2,3,Aspect_TOE_VISIBLE);
mesEdges(3) = Aspect_Edge(3,1,Aspect_TOE_VISIBLE);