Your strip counts should be:
int[] strips = new int[]{4, 4};
and countour counts should be:
int[] countours = new int[]{2};
Matti.
-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED] Behalf Of aant
Sent: 11. maaliskuuta 2004 17:45
To: [EMAIL PROTECTED]
Subject: [JAVA3D] GeometryInfo
Hello,
I have a problem using GeometryInfo.
I use GeometryInfo to cut a hole in a polygon. With the following data I
get the error message "java.lang.IllegalArgumentException: Sum of
contourCounts must equal length of stripCounts array"
But the sum of the contourcounts equals 8 (=4+4) what is exactly the
number of the coords. (the first 4 coords are the polygon and the last 4
coords are from the hole inside). Who can tell me what im doing wrong.
With regards Aant van der Zee
coord: (-3.924, 2.7, -15.614)
coord: (-3.924, 2.7, -4.064)
coord: (-3.924, 0.0, -4.064)
coord: (-3.924, 0.0, -15.614)
coord: (-3.924, 0.6, -15.314)
coord: (-3.924, 2.4, -15.314)
coord: (-3.924, 2.4, -4.9640007)
coord: (-3.924, 0.6, -4.9640007)
countorcounts[0] = 4
countorcounts[0] = 4
private GeometryArray createGeometryArray(Point3f[] coords,
int[] contourCounts,
Color3f[] colors) {
GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
gi.setCoordinates(coords);
if ( colors != null )
gi.setColors(colors);
int[] ii = {
coords.length};
gi.setStripCounts(ii);
if ( contourCounts != null) {
gi.setContourCounts(contourCounts);
}
NormalGenerator ngi = new NormalGenerator();
ngi.generateNormals(gi);
Stripifier sti = new Stripifier();
sti.stripify(gi);
return gi.getGeometryArray();
}
========================================================================
=== 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".