Why does this IV file crash ivview?

Why does this IV file crash ivview?

Post by Michael E. Warre » Sat, 25 Mar 2000 04:00:00



Can anyone tell me why the following inventor file
crashes ivview?

#Inventor V2.1 ascii

Material
{
    diffuseColor
    [
        0 0 0,
        0 0 1,
        0 1 0,
        0 1 1,
        1 0 0,
        1 0 1,
        1 1 0,
        1 1 1
    ]

Quote:}

VertexProperty
{
    vertex
    [
        0 0 0,
        0 0 1,
        0 1 0,
        0 1 1,
        1 0 0,
        1 0 1,
        1 1 0,
        1 1 1
    ]
    materialBinding PER_VERTEX_INDEXED

Quote:}

IndexedFaceSet
{
    coordIndex
    [
        0, 1, 3, 2, -1,
        4, 6, 7, 5, -1,
        0, 4, 5, 1, -1,
        2, 3, 7, 6, -1,
        0, 2, 6, 4, -1,
        1, 5, 7, 3, -1
    ]
    materialIndex
    [
        3, 2, 4, 2, 4, 6, 2, 3
    ]

Quote:}

I'm attempting to figure out how to create a list of
colors/transparencies and associate them with the
vertex points of a shape.  I want to be able to reuse
the Material colors.  For example,  I may have 100
points onto which I'd like to map 10 colors.

In the previous file, I attempted to create a color
cube where the xyz coordinate of each point corresponds
to a rgb value.  It crashes ivview, but I've not been
able to find out what was wrong.

I need to be able to load the eventual file with Perfly,
as well as ivview.  I orginally tried to specify colors and
textures with the orderedRGBA field in the VertexProperty
node, but the Performer IV loader didn't seem to recognize
that.

Thank in advance for the help.

Mike

--
Michael E. Warren
Communications Science and Technology
Applied Research Lab, Penn State University
Office: 814-863-6237

  Http: http://www.personal.psu.edu/~mew9

 
 
 

Why does this IV file crash ivview?

Post by Michael E. Warre » Sat, 25 Mar 2000 04:00:00


It looks like the material binding in a VertexProperty
is only valid for the RGBA values in the VertexProperty,
and is ignored if there are no RGBA values specified.
When I use a material binding node and a Coordinate3
node, my shape loads in ivview and perfly.

My experience suggests that I need a color / transparency
for each vertex ( that they can't be reused ).  Has anyone
been able to index assign (and reuse) material colors to
vertices?

Mike

--
Michael E. Warren
Communications Science and Technology
Applied Research Lab, Penn State University
Office: 814-863-6237

  Http: http://www.personal.psu.edu/~mew9

 
 
 

Why does this IV file crash ivview?

Post by Mike Hec » Sat, 25 Mar 2000 04:00:00



> Can anyone tell me why the following inventor file
> crashes ivview?
<...snip...>
> IndexedFaceSet
> {
>     coordIndex
>     [
>         0, 1, 3, 2, -1,
>         4, 6, 7, 5, -1,
>         0, 4, 5, 1, -1,
>         2, 3, 7, 6, -1,
>         0, 2, 6, 4, -1,
>         1, 5, 7, 3, -1
>     ]
>     materialIndex
>     [
>         3, 2, 4, 2, 4, 6, 2, 3
>     ]
> }

You said the material should be per-vertex-indexed,
and you have 24 vertices but only 8 material indices.
If you run a debug build of ivview I think you'll get
a warning message.

-Mike
 TGS Inc, http://www.tgs.com

 
 
 

Why does this IV file crash ivview?

Post by Michael E. Warre » Wed, 29 Mar 2000 04:00:00




> > Can anyone tell me why the following inventor file
> > crashes ivview?
> <...snip...>
> > IndexedFaceSet
> > {
> >     coordIndex
> >     [
> >         0, 1, 3, 2, -1,
> >         4, 6, 7, 5, -1,
> >         0, 4, 5, 1, -1,
> >         2, 3, 7, 6, -1,
> >         0, 2, 6, 4, -1,
> >         1, 5, 7, 3, -1
> >     ]
> >     materialIndex
> >     [
> >         3, 2, 4, 2, 4, 6, 2, 3
> >     ]
> > }

> You said the material should be per-vertex-indexed,
> and you have 24 vertices but only 8 material indices.
> If you run a debug build of ivview I think you'll get
> a warning message.

> -Mike
>  TGS Inc, http://www.tgs.com

Thanks for the reply.

Are you saying that the materialIndex values are matched
to the coordIndex values?  I have 8 vertices that are used
to construct 6 faces of 4 points each.  I thought that the
contents of the materialIndex were indices into the current
Material settings and were matched to the current vertex
list.

Mike

--
Michael E. Warren
Communications Science and Technology
Applied Research Lab, Penn State University
Office: 814-863-6237

  Http: http://www.personal.psu.edu/~mew9

 
 
 

Why does this IV file crash ivview?

Post by Mike Hec » Wed, 29 Mar 2000 04:00:00



> Are you saying that the materialIndex values are matched
> to the coordIndex values?  I have 8 vertices that are used
> to construct 6 faces of 4 points each.  I thought that the
> contents of the materialIndex were indices into the current
> Material settings and were matched to the current vertex
> list.

Have to be careful about terminology here. :)  When you say
"vertex list" in the last sentence, I think you mean the
"coordinate list" specified in an SoCoordinate node or an
SoVertexProperty node.  These are just raw coordinates and
don't imply anything about how many *vertices* there are in
an indexed faceset (IFS).  Each vertex in an IFS is defined
by a value (other than -1) in the coordIndex field.  There
may be many more vertices than unique coordinate values.
You have 8 coordinates and 24 vertices in your .iv file.

When you specify the material binding PER_VERTEX_INDEXED,
that means you will provide a material index per *vertex*.
Therefore, in this case, you need 24 material indices
(of course there are only 8 unique materials, just as there
are only 8 unique coordinates).

-Mike
 TGS Inc, http://www.tgs.com

 
 
 

Why does this IV file crash ivview?

Post by Michael E. Warre » Fri, 31 Mar 2000 04:00:00


Ah, I understand now.  I WAS confusing the idea of a
coordinate and a vertex.  So a coordinate is just a point
in space, and a vertex is a point used in the construction
of a face?  Thanks for clearing up the difference.

Mike


> Have to be careful about terminology here. :)  When you say
> "vertex list" in the last sentence, I think you mean the
> "coordinate list" specified in an SoCoordinate node or an
> SoVertexProperty node.  These are just raw coordinates and
> don't imply anything about how many *vertices* there are in
> an indexed faceset (IFS).  Each vertex in an IFS is defined
> by a value (other than -1) in the coordIndex field.  There
> may be many more vertices than unique coordinate values.
> You have 8 coordinates and 24 vertices in your .iv file.

> When you specify the material binding PER_VERTEX_INDEXED,
> that means you will provide a material index per *vertex*.
> Therefore, in this case, you need 24 material indices
> (of course there are only 8 unique materials, just as there
> are only 8 unique coordinates).

> -Mike
>  TGS Inc, http://www.tgs.com

--
Michael E. Warren
Communications Science and Technology
Applied Research Lab, Penn State University
Office: 814-863-6237

  Http: http://www.personal.psu.edu/~mew9