Hello everyone,

I've got problem with texturing GeometryInfo.
I have cod like this:

    Point3f p1 = new Point3f(0.5f, 0.5f, 0.0f);
    Point3f p2 = new Point3f(0.5f, 0.0f, 0.0f);
    Point3f p3 = new Point3f(0.3f, -0.3f, 0.0f);

    Point3f p4= new Point3f(-0.3f, -0.3f, 0.0f);
    Point3f p5 = new Point3f(-0.5f, 0.0f, 0.0f);
    Point3f p6 = new Point3f(-0.3f, 0.3f, 0.0f);


    Point3f[] table = new Point3f[6];
    int[] stripCounts = {6};
    table[0] = p1;
    table[1] = p2;
    table[2] = p3;
    table[3] = p4;
    table[4] = p5;
    table[5] = p6;

    GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
    gi.setCoordinates(table);
    gi.setStripCounts(stripCounts);

    Triangulator tr = new Triangulator();
    NormalGenerator ng = new NormalGenerator();
    Stripifier s = new Stripifier();
    tr.triangulate(gi);
    ng.generateNormals(gi);
    s.stripify(gi);


    /*tekstury*/
    TexCoord2f t1 = new TexCoord2f(0.0f,1.0f);
    TexCoord2f t2 = new TexCoord2f(1.0f,1.0f);
    TexCoord2f t3 = new TexCoord2f(0.0f,0.0f);
    TexCoord2f t4 = new TexCoord2f(1.0f,0.0f);
    TexCoord2f t5 = new TexCoord2f(0.5f,0.0f);
    TexCoord2f t6 = new TexCoord2f(1.0f,0.5f);
    TexCoord2f[] texcoords = new TexCoord2f[5];
    texcoords[0] = t1;
    texcoords[1] = t2;
    texcoords[2] = t3;
    texcoords[3] = t4;
    texcoords[4] = t5;
    //texcoords[5] = t6;

    gi.setTextureCoordinateParams(1, 2);

    gi.setTextureCoordinates(0, texcoords);


    return gi.getGeometryArray();


    Now , by the line return gi.getGeometryArray(); I get exception:

    java.lang.IllegalArgumentException: Missing Index List.

    HOW CAN I PROPERLY PUT TEXTURE COORDINATES ON GEOMETRYINFO OBJECT
    ???

       Regards,
       Marcin Bober.



--
Best regards,
 Marcinek                          mailto:[EMAIL PROTECTED]

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