# My method getRoad (TriMesh) don

I don

You get a null pointer exception because any value in the vertex or texCoord array is null. You need to create a vector object instead of setting it.

``` vertex[i] = new Vector3f(start_x, start_y + pass*i/2, 0); ```

tanks, now is working, but i did this too:

`for (int i = 0; i < size/pass*2; i += 2) {`

my texCoord isn

Now is working

```        public TriMesh getRoad(int start_x, int start_y, int length, int size, int pass) {             Vector3f[] vertex = new Vector3f[(size/pass)*2];             Vector2f[] texCoord = new Vector2f[(size/pass)*2];             int[] indexes = new int[(size/pass)*6-6];             int j = 1, k = 0;             for (int i = 0; i < size/pass*2; i += 2) {                 vertex[i] = new Vector3f(start_x, start_y + pass*i/2, 0);                 vertex[i+1] = new Vector3f(start_x + length, start_y + pass*i/2, 0);                 switch (i) {                     case 30:                         vertex[i].setZ(1);                         vertex[i+1].setZ(1);                     case 31:                         vertex[i].setZ(2);                         vertex[i+1].setZ(2);                     case 32:                         vertex[i].setZ(1);                         vertex[i+1].setZ(1);                 }                                 texCoord[i+1] = new Vector2f(0, i);                 texCoord[i] = new Vector2f(length/pass, i);                 if (i != 0) {                     indexes[k] = (j);//point 1                     indexes[k+1] = (j+1);//point 2                     indexes[k+2] = (j-2);//point 3                     k += 3;                 }                 if (i != size/pass*2-2) {                     indexes[k] = (j);//point 1                     indexes[k+1] = (j+1);//point 2                     indexes[k+2] = (j+3);//point 3                     k += 3;                 }                 j += 2;             }             TriMesh Road = new TriMesh("My Road", BufferUtils.createFloatBuffer(vertex), null, null,                     BufferUtils.createFloatBuffer(texCoord), BufferUtils.createIntBuffer(indexes));             return Road;         }```

Only this problem: img is broken, look here:

http://paginas.terra.com.br/lazer/egmpnb/imagem.PNG

maybe your host doesn't like PNGs, I get redirected to http://paginas.terra.com.br/forbidden.htm

Babelfish told me it is written in Portugese and means: