如何为多边形面着色-例如,仅将颜色 1 面全为红色。当我继续为相邻面着色时,我不希望发生线性插值。我可以使用以下代码对其进行着色,但颜色会合并。当我将 colorPerVertex 设置为 false 时,颜色看起来很奇怪。请指教。谢谢你。
<X3D>
<Scene>
<Shape>
<IndexedFaceSet solid="false" colorPerVertex="true"
coordIndex="0 3 4 1 -1
1 4 5 2 -1
3 6 7 4 -1
4 7 8 5 -1">
<Coordinate
point= "0 0 0, 1 0 0, 2 0 0
0 0 1, 1 3 1, 2 0 1
0 0 2, 1 0 2, 2 0 2" />
<Color color= "0 0 0, 1 0 0, 2 0 0
0 0 1, 1 3 1, 2 0 1
0 0 2, 1 0 2, 2 0 2" />
</IndexedFaceSet>
<Appearance>
<Material diffuseColor='1 0 0' />
</Appearance>
</Shape>
</Scene>
</X3D>