[Top] [All Lists]

Re: Per-face material assignment for SoIndexedFaceSet

To: <info-inventor-dev@xxxxxxxxxxx>
Subject: Re: Per-face material assignment for SoIndexedFaceSet
From: "Tamstorf, Rasmus" <Rasmus.Tamstorf@xxxxxxxxxx>
Date: Mon, 17 Mar 2003 12:19:30 -0800 (PST)
Cc: Morten Eriksen <mortene@xxxxxx>
In-reply-to: <51isuhpxkf.fsf@xxxxxxxxxxxxxx>
Sender: info-inventor-dev-bounce@xxxxxxxxxxx
Thanks a lot ! 

The first two "problems" are due to my hand-editing since 
the original file *is* using extension nodes (but that's really irrelevant 
for the real problem). 

As for number 2) I believe you can place the VertexProperty node outside
the shapenode although the documentation says that you will pay dearly for
it in terms of performance.

Finally number 3) is the real problem, and obviously something I should
have noticed. Duh !!

Thanks again :)

On 17 Mar 2003, Morten Eriksen wrote:

> "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

Rasmus.Tamstorf@xxxxxxxxxx         "A problem worthy of attack, 
Walt Disney Feature Animation       proves its worth by hitting back" Kumbel

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