Michael Pfeiffer wrote:


Doesn't work


Case 1:

def createNormals(self):
 gi = GeometryInfo(GeometryInfo.TRIANGLE_ARRAY| LineArray.COLOR_3)
 gi.setCoordinates(self.verts)
 nm = NormalGenerator()
 nm.generateNormals(gi)
 si = Stripifier()
 si.stripify(gi)
 return gi.getGeometryArray(1,0,0)

Result:

java.lang.IllegalArgumentException: StripCounts inconsistent with
primitive
at com.sun.j3d.utils.geometry.GeometryInfo.checkForBadData

Doesn't work

def createNormals(self):
       gi = GeometryInfo(GeometryInfo.TRIANGLE_ARRAY |
GeometryArray.COLOR_3)
       gi.setCoordinates(self.verts)
       nm = NormalGenerator()
       nm.generateNormals(gi)
       gi.unindexify()
       si = Stripifier()
       si.stripify(gi)
       return gi.getGeometryArray(1,0,0)

Does Work

def createNormals(self):
       gi = GeometryInfo(GeometryInfo.TRIANGLE_ARRAY)
       gi.setCoordinates(self.verts) #set colors
       gi.setColors(0, ....)
       nm = NormalGenerator()
       nm.generateNormals(gi)
       gi.unindexify()
       si = Stripifier()
       si.stripify(gi)
       return gi.getGeometryArray(1,0,0)

*But  a call to setColorRef3b later on in the code
*
shape.setColorRef3b(colors)  dumps with the following
java.lang.IllegalArgumentException: GeometryArray: array reference is
already non-null     at
javax.media.j3d.GeometryArrayRetained.setColorRef3b(GeometryArrayRetained.java:8610)

Catch 22 ?

PS exactly how does GeometryInfo calculate Normals there are a number of
methods


Chris


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

Reply via email to