The shading model of a polygon is set using the Shade Model command.
Shade Model (mode)
where mode can be SMOOTH (the default) or FLAT. SMOOTH shading interpolates the colors of the primitive from one vertex to the next. FLAT mode duplicates the color of one vertex across the entire primitive.
The following script changes the color at each of a triangle’s vertices. The FILL shade model interpolates the color of the interior automatically.
scene << Clear;
scene << Shade Model( SMOOTH );
scene << Polygon Mode( FRONT_AND_BACK, FILL );
scene << Begin( TRIANGLES );
scene << End();
scene << Update;
图 13.17 Shading