[Top] [All Lists]

Re: Per-face material assignment for SoIndexedFaceSet

To: "Tamstorf, Rasmus" <Rasmus.Tamstorf@xxxxxxxxxx>
Subject: Re: Per-face material assignment for SoIndexedFaceSet
From: Morten Eriksen <mortene@xxxxxx>
Date: 17 Mar 2003 21:06:40 +0100
Cc: <info-inventor-dev@xxxxxxxxxxx>
In-reply-to: "Tamstorf, Rasmus"'s message of "Mon, 17 Mar 2003 10:29:06 -0800 (PST)"
Organization: Systems in Motion
References: <Pine.LNX.4.33.0303171020380.18212-200000@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: <info-inventor-dev@xxxxxxxxxxx>
Sender: info-inventor-dev-bounce@xxxxxxxxxxx
User-agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.4
"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.


Attachment: test.iv
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>