I think the number of elements in each index arrray such as coordinate indices,
color indices, normal indices is the same but the number of elements in each
data array such as coordinates, colors, normals and texture coordinates do not
need to be the same. As data array can map to corresponding index array, there
exist a one-to-one reference, and all index arrays share the same order,
therefore, each index can reference its coordinate index, color index and so on.
These indices can further reference its corresponding data such as coordinate,
color or normal. So I do see the reason why the data arrays should have the same
number of elements. Unfortunately, it seems that Java3d works this way.
"Yazel, David J." wrote:
> Yes you are correct. The colors, tex coords, normals and coordinates need
> to be the same. So you end up duplicating your colors, etc, when you dont
> really want to. I never found a way to solve that problem.
>
> You should be able to to have
>
> colors [c1]
> texCoords[t1,t2,t3]
> normals [n1,n2,n3]
> coordinates[v1,v2,v3]
>
> and set indices
>
> coordinates[0,1,2]
> colors[0,0,0]
> texCoords[0,1,2]
> normals [0,1,2]
>
> But you can't
>
> Dave Yazel
>
> > ----------
> > From: Liming CHEN[SMTP:[EMAIL PROTECTED]]
> > Reply To: Discussion list for Java 3D API
> > Sent: Wednesday, December 20, 2000 7:56 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [JAVA3D] use of IndexTriangleArray class
> >
> > Hi, Yazel,
> >
> > After reading your discussion, my question is simplified as following:
> >
> > If I have a geometry with 20 vertices and 38 vertex index, I am sure that
> > there
> > should be 20 vertex coordinates. What I want to know is how many normals
> > and
> > texture coordinates there should be. According to your message, it seems
> > for me
> > that there also should be 20 normals and 20 texture coordinates for each
> > of the
> > vertex. Right?
> >
> > But I think the number of normals or texture coordinates should be allowed
> > to be
> > more than (or perhaps less than ) the number of vertices (here it is 20)
> > as
> > long as the size of normal index and texture coordinate index are the same
> > as
> > the size of vertex coordinate index.
> >
> > If what I said is right, for example, the normals are 30 (rather than 20),
> > then
> > when using the setNormals(index, norms) to set the normals, there is a
> > error
> > message "java.lang.ArrayIndexOutOfBoundsException". In my understanding,
> > this is
> > because the index is 20 while the norms is 30.
> >
> > I have found that VRML has provided the functionality that I just
> > mentioned when
> > using IndexedFaceSet to generate a geometry.
> >
> > Is It my fault or the Java3D just providessuch function?
> >
> > Liming
> >
> > ==========================================================================
> > =
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> > body
> > of the message "signoff JAVA3D-INTEREST". For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".