"Tamstorf, Rasmus" <Rasmus.Tamstorf@xxxxxxxxxx> writes:
> I hope this is something really simple, which I've just overlooked,
> but as it is I can't get per-face material/color assignment to work
> for SoIndexedFaceSet.
>
> I've attached a simple iv file [...]
The iv file has many problems:
0) Nodes shouldn't be named with their "So"
prefix. "SoSeparator" and "SoIndexedFaceSet" in your file
should simply be "Separator" and "IndexedFaceSet".
1) If the first line of a node specification is the string
"fields [ ... ]", this is supposed to signify that the node
is an *extension* node, not a built-in Inventor node. Remove
those lines.
2) A VertexProperty node should be placed _within_ it's
shapenode (in the SFNode "vertexProperty" field), not before
it in the scene graph.
3) The VertexProperty orderedRGBA field doesn't contain the
values you think it does. To get one red and one green
color, it should be
orderedRGBA [ 0xff0000ff, 0x00ff00ff ]
while your
orderedRGBA [ 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff ]
is actually *8* color values (all of them either 0x000000ff
(black, opaque) or 0x00000000 (fully transparent)).
You need to fix at least 2) and 3) to get what you expected, possibly
also 0) and 1), I didn't check. I've attached a fully corrected file
at the end of this mail.
Regards,
Morten
--
<URL:http://www.coin3d.org>
test.iv
Description: Text document
|