Duncan:
You are setting the capability bits as part of the vertexFormat and this
is incorrect. vertexFormat only specifies what components of the vertex (such
as texture, color etc..) are present. use setCapability() method to set the
capability bits.
The GeometryArray doc clearly states that:
GeometryArray
public GeometryArray(int vertexCount,
int vertexFormat,
int texCoordSetCount,
int[] texCoordSetMap)
Constructs an empty GeometryArray object with the specified number of
vertices, vertex format, number of texture coordinate sets, and texture
coordinate mapping array. Defaults are used for all other parameters.
Parameters:
vertexCount - the number of vertex elements in this GeometryArray
vertexFormat - a mask indicating which components are present in
each vertex. This is specified as one or more individual flags
that are bitwise "OR"ed together to describe the per-vertex data.
The flags include: COORDINATES, to signal the inclusion of vertex
positions--always present; NORMALS, to signal the inclusion of per
vertex normals; one of COLOR_3 or COLOR_4, to signal the inclusion
of per vertex colors (without or with alpha information); one of
TEXTURE_COORDINATE_2 or TEXTURE_COORDINATE_3, to signal the
inclusion of per-vertex texture coordinates (2D or 3D);
BY_REFERENCE, to indicate that the data is passed by reference
rather than by copying; INTERLEAVED, to indicate that the
referenced data is interleaved in a single array.
[ Rest of the stuff deleted .....]
-Uma
Java3D Team
> Encoding: 29 TEXT, 35 UUENCODE, 72 UUENCODE
> X-MS-Attachment: InterleavedBug.class 0 00-00-1980 00:00
> X-MS-Attachment: InterleavedBug.java 0 00-00-1980 00:00
> Date: Wed, 3 May 2000 22:15:54 +0100
> From: Duncan Woods <[EMAIL PROTECTED]>
> Subject: [JAVA3D] *bug* - Interleaved TriangleArray
> To: [EMAIL PROTECTED]
>
> Hi list,
> I believe I have found a bug in the creation of an Interleaved
> TriangleArray in Java 1.2b
>
> If you set either of the count capabilities in the constructor then a
> mysterious requirement for 2 additional floats per vertex is required in
> the interleaved array. If you set both, then the need increases to 4 per
> vertex.
>
> The noticeable error is therefore the ArrayIndexOutOfBoundsException which
> occurs when setting a perfectly legal referenced array.
>
> If you set the capabilities outside of the constructor then all is fine.
>
> However, if you are always meant to do this then it clearly isn't a bug but
> the API documentation is desperately un-clear and should be remedied.
>
> I have attached an example class to demonstrate this. It simply shows the
> exception occurring when trying to set the same array to a slightly
> differently created triangleArray.
>
> (I know its crappily written - but I'm tired and p*ssed off)
>
>
>
> Duncan.
>
>
>
>
> begin 600 InterleavedBug.class
> MROZZO@`#`"T`40@`- @`-0@`-P<`. <`/P<`0 <`00<`0@<`0P<`1 <`10<`
> M1@<`1P<`2 <`20H`"0`="@`/`!X*``\`'PH`"@`@"@`*`"$*``X`(@D`"P`C
> M"@`'`"0*``4`)0H`#@`F"@`-`"<*``H`* H`# `H# `S`"H,`#,`+ P`,P`M
> M# `S`# ,`#T`+PP`/@`K# !+`#L,`$P`+@P`30`P# !.`"L,`$\`,0P`4 `I
> M`0`4*"E,:F%V82]L86YG+U-T<FEN9SL!``,H*58!``0H22E6`0`%*$E)*58!
> M``@H24E)6TDI5@$`%2A,:F%V82]L86YG+U-T<FEN9SLI20$`+"A,:F%V82]L
> M86YG+U-T<FEN9SLI3&IA=F$O;&%N9R]3=')I;F="=69F97([`0`5*$QJ879A
> M+VQA;F<O4W1R:6YG.RE6`0`%*%M&*58!`!8H6TQJ879A+VQA;F<O4W1R:6YG
> M.RE6`0`&/&EN:70^`0`I07)G=6UE;G1S.B P(#T@8V%U<V4@8G5G+" Q(#T@
> M<')E=F5N="!B=6<!``U"=6<@;V-C=7)E9#H@`0`$0V]D90$`!$1O;F4!``Y)
> M;G1E<FQE879E9$)U9P$`$TEN=&5R;&5A=F5D0G5G+FIA=F$!``],:6YE3G5M
> M8F5R5&%B;&4!`!5,:F%V82]I;R]0<FEN=%-T<F5A;3L!``I3;W5R8V5&:6QE
> M`0`&87!P96YD`0`/8VQE87)#87!A8FEL:71Y`0`3:F%V82]I;R]0<FEN=%-T
> M<F5A;0$`*&IA=F$O;&%N9R]!<G)A>4EN9&5X3W5T3V9";W5N9'-%>&-E<'1I
> M;VX!`!%J879A+VQA;F<O26YT96=E<@$`'VIA=F$O;&%N9R].=6UB97)&;W)M
> M871%>&-E<'1I;VX!`!!J879A+VQA;F<O3V)J96-T`0`6:F%V82]L86YG+U-T
> M<FEN9T)U9F9E<@$`$&IA=F$O;&%N9R]3>7-T96T!`!-J879A+VQA;F<O5&AR
> M;W=A8FQE`0`=:F%V87@O;65D:6$O:C-D+T=E;VUE=')Y07)R87D!`"!J879A
> M>"]M961I82]J,V0O4V-E;F5'<F%P:$]B:F5C= $`'6IA=F%X+VUE9&EA+VHS
> M9"]4<FEA;F=L94%R<F%Y`0`$;6%I;@$``V]U= $`"'!A<G-E26YT`0`'<')I
> M;G1L;@$`#7-E=$-A<&%B:6QI='D!`!9S971);G1E<FQE879E9%9E<G1I8V5S
> M`0`(=&]3=')I;F<`(0`$``D```````(``0`S`"H``0`V````'0`!``$````%
> M*K<`$+$````!`#H````&``$````*``D`2@`R``$`-@```7@`!@`$````P! 8
> MO 9,NP`/608$MP`132H#,K@`%ZH``````'0``````````0```!<````[NP`/
> M6081`;\$!+P*MP`232P'M@`5+! ,M@`5+!! M@`5IP`\NP`/6081`;,$!+P*
> MMP`232P'M@`5+! ,M@`5+!! M@`5+! (M@`9+! 4M@`9IP`,5[(`%A(!M@`8
> M+"NV`!JG`!U.L@`6NP`*61("MP`3+;8`'+8`%+8`&[8`&+(`%A(#M@`8IP`,
> M5[(`%A(!M@`8L0`#``\`@ " ``@`B0".`)$`!@```+,`M@`&``$`.@```(X`
> M(P````X````0``4`$@`/`!0`#P`5`"P`&P`Q`",`- `E`#@`&P`\`"8`00`G
> M`$<`* !-`"H`4 `P`%4`-0!8`#H`7 `P`& `/ !E`#T`:P`^`'$`00!W`$(`
> M?0!$`( `2 "!`$D`B0!-`(D`3@".`$T`D0!0`)(`40"K`%,`LP`.`+8`6 "W
> 0`%D`OP`-``$`/ ````(`.8D`
> `
> end
>
> begin 600 InterleavedBug.java
> M:6UP;W)T(&IA=F%X+FUE9&EA+FHS9"XJ.PT*#0HO+R!"54<@4D503U)4("T@
> M1'5N8V%N($$N(%=O;V1S("T@0V]P>7)I9VAT(#4O-"\P, T*+R\@5&AE(&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5214Y#
> M12!\#0H)"0D)"0D)"0D)"2!4<FEA;F=L94%R<F%Y+DE.5$523$5!5D5$('P-
> M"@D)"0D)"0D)"0D)(%1R:6%N9VQE07)R87DN0T]/4D1)3D%415,@? T*"0D)
> M"0D)"0D)"0D@5')I86YG;&5!<G)A>2Y.3U)-04Q3('P-"@D)"0D)"0D)"0D)
> M(%1R:6%N9VQE07)R87DN5$585%5215]#3T]21$E.051%7S(@? T*"0D)"0D)
> M"0D)"0D@5')I86YG;&5!<G)A>2Y!3$Q/5U]2149?1$%405]214%$('P-"@D)
> M"0D)"0D)"0D)(%1R:6%N9VQE07)R87DN04Q,3U=?4D5&7T1!5$%?5U))5$4@
> M? T*"0D)"0D)"0D)"0D)+R\@<V5T(&-O=6YT(&-A<&%B:6QI=&EE<PD)( T*
> M"0D)"0D)"0D)"0D@5')I86YG;&5!<G)A>2Y!3$Q/5U]#3U5.5%]74DE412!\
> M#0H)"0D)"0D)"0D)"2!4<FEA;F=L94%R<F%Y+D%,3$]77T-/54Y47U)%040@
> M#0H)"0D)"0D)"0D)"2 L(#$L(&YE=R!I;G1;72R87DN0EE?4D5&
> M15)%3D-%('P-"@D)"0D)"0D)"0D)(%1R:6%N9VQE07)R87DN24Y415),14%6
> M140@? T*"0D)"0D)"0D)"0D@5')I86YG;&5!<G)A>2Y#3T]21$E.051%4R!\
> M#0H)"0D)"0D)"0D)"2!4<FEA;F=L94%R<F%Y+DY/4DU!3%,@? T*"0D)"0D)
> M"0D)"0D@5')I86YG;&5!<G)A>2Y415A455)%7T-/3U)$24Y!5$5?,B!\#0H)
> M"0D)"0D)"0D)"2!4<FEA;F=L94%R<F%Y+D%,3$]77U)%1E]$051!7U)%040@
> M? T*"0D)"0D)"0D)"0D@5')I86YG;&5!<G)A>2Y!3$Q/5U]2149?1$%405]7
> M4DE412 O+WP-"@D)"0D)"0D)"0D)"2\O('-E="!C;W5N="!C87!A8FEL:71I
> M97,@;&%T97()"2 -"@D)"0D)"0D)"0D)("\O5')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DI
> M.PT*"0E]#0H)"5-Y<W1E;2YO=70N<')I;G1L;B@B1&]N92(I.PT*"0D-"@D)
> M#0H)"7T-"@D)#0H)"6-A=&-H("A!<G)A>4EN9&5X3W5T3V9";W5N9'-%>&-E
> M<'1I;VX@92D@>PT*"0D)4WES=&5M+F]U="YP<FEN=&QN*")!<F=U;65N=',Z
> M(# @/2!C875S92!B=6<L(#$@/2!P<F5V96YT(&)U9R(I.PT*"0E]"0D)#0H)
> .?0T*#0H-"GT-"@T*#0HL
> `
> end
>
> ===========================================================================
> 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".