It looks like a good part of your problem might be that you are only
initializing the first two elements of your Point3f[] array (coords[]) in
your getPlane() method:
coords[0]=new Point3f( 0.0f,0.0f,0.0f);
coords[1]=new Point3f( 0.2f,0.2f,0.0f);
coords[0]=new Point3f( 0.1f,0.3f,-0.2f);
coords[1]=new Point3f( 0.2f,0.4f,-0.3f);
coords[0]=new Point3f( 0.1f,0.2f,-0.4f);
coords[1]=new Point3f( 0.3f,0.5f,-0.6f);
On Sat, 5 Jun 1999, dave frost wrote:
> Hi everyone,
>
> I am having a small problem with a bit of code - it is possibly quite
> obvious but this is the first time i have used my own geometry and so
> have never come across this before.
>
> I am trying to generate a small plane from a TriangleStripArray. The
> code below compiles fine, but when i try to run it i get this exception:
>
> Exception in thread main java.lang.NullPointerException
> at javax.media.j3d.GeometryArrayRetained.setCoordinates(Compiled
> code)
> at javax.media.j3d.GeometryArray.setCoordinates(
> GeomaetryArray.java:333)
> genStrips.getPlane( genStrip.java:72)
> genStrips.getScene( genStrip.java:40)
> genStrips.<init>(genStrips.java:24)
> at genStrips.main(genStrips.java:14)
>
> I have attatched the code - it is called genStrips.java i would be realy
> grateful if you could have a look and see what you think
>
> Thanks loads
>
> Dave
>
>
genStrips.java