我如何着色一个多边形的脸-就像在仅仅颜色1的脸全部红色,例如。我不希望当我继续给相邻的脸着色时会发生线性插值。我可以用以下代码给它着色,但颜色合并了。当我把colorPerVertex变成假的时候,颜色看起来很奇怪。请指点。谢谢。
<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>发布于 2013-11-25 00:26:39
如果colorPerVertex为FALSE,且colorIndex字段不是空的,则为IndexedFaceSet的每个面都应用一种颜色。
因此,如果在示例中将colorPerVertex设置为FALSE,则不应该在人脸之间进行颜色插值(测试)。
https://stackoverflow.com/questions/20169571
复制相似问题