> From: Jesse Thompson <[EMAIL PROTECTED]>
>
> 
> I am trying to generate a set of normals for a TriangleStripArray (TSA)
> object.  I'm trying to use the NormalGenerator, so I need to pass the
> coordinates on to a GeometryInfo object.  In order to do this, (please
> correct me if I'm wrong) I believe I have to get the coordinates from the
> TSA to a Point3f[]. I am intializing the Point3f[] with 
> 
> Point3f[] temp = new Point3f[tsa.getVertexCount()];
> 
> and then 
> 
> tsa.getCoordinates(0,temp); // the 0 indicates where to start in the tsa
> 
> I am getting a NullPointerException at:
> 
>  at javax.media.j3d.GeometryArrayRetained.getCoordinates
> 
> Which corresponds to the tsa.getCoordinates() call above.
> 
> Does anybody know how I can get these TSA coordinates over to the 
> GeometryInfo object?

You have initialized the Point3f[] array, but not it's contents.  Try allocating 
a Point3f for each entry in the array and see if that works:

        for (int i = 0; i < temp.length; i++) {
            temp[i] = new Point3f();
        }
        tsa.getCoordinates(0, temp);
        
Doug Gehringer
Sun Microsystems

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to