Any suggestions for a hole in a flat mesh?

Hey all, back again with another question.



I have a 'custom' plane (created out of 'tiles'), and would like to construct it with certain tiles omitted.



Heres the code I am using, the plane is col and row based; and ideally I would like to have the edges that connect the tiles (that should be omitted) not created.  I am kind of at a loss though,  I also had the idea to use a quad on top with an alpha state that would let me see 'through' the hole; however that hides everything, I want to be able to 'see' through it…



Any hints or suggestions are welcome, I think I know how to do it; but my approach would require some testing to see if its on the edge or not (read lots of if statements).  Basically I am seeing if anyone has a clever approach that I may have overlooked…





            private void buildFloor() {

                final Vector3f[] verticies = new Vector3f[ ( length + 1 ) * ( width + 1 ) ];
                final Vector3f[] normals = new Vector3f[ ( length + 1 ) * ( width + 1 ) ];
                final Vector2f[] textures = new Vector2f[ ( length + 1 ) * ( width + 1 ) ];

                for( int row = 0; row < length + 1; ++row ){
                    for( int col = 0; col < width + 1; ++col ){

                        // if( !skipColsAndRows[row][col] ){
                        int index = col + ( row * ( width + 1 ) );
                        verticies[index] = new Vector3f( col * tileSize, 0, row * tileSize );
                        normals[index] = new Vector3f( 0, 1, 0 );
                        textures[index] = new Vector2f( col / ( (float) width ), row / ( (float) length ) );
                    // }

                    }
                }

                final FloatBuffer vertexBuffer = BufferUtils.createFloatBuffer( verticies );
                final FloatBuffer normalBuffer = BufferUtils.createFloatBuffer( normals );
                final FloatBuffer textureBuffer = BufferUtils.createFloatBuffer( textures );
                final IntBuffer indices = BufferUtils.createIntBuffer( getIndices() );

                mesh = new TriMesh( "Floor", vertexBuffer, normalBuffer, null, textureBuffer, indices );
                attachChild( mesh );

                mesh.setModelBound( new BoundingBox() );
                mesh.updateModelBound();
                setIsCollidable( true );

                // Center it at (0,0,0)
                mesh.getLocalTranslation().subtractLocal( width * tileSize / 2, 0, length * tileSize / 2 );
                mesh.updateGeometricState( 0, true );

            }

            private int[] getIndices() {

                int numberOfVerts = ( length * width * 2 * 3 );       // 2 Tris/cell, 3 Verts/Tri
                int[] indices = new int[ numberOfVerts ];   //

                for( int row = 0; row < length; ++row ){
                    for( int col = 0; col < width; ++col ){
                        int index = ( col + ( row * width ) ) * 6;

                        //  if( !skipColsAndRows[row][col] ){
                        // Make 2 triangles
                        indices[index] = col + ( row * ( width + 1 ) );
                        indices[index + 1] = col + ( ( row + 1 ) * ( width + 1 ) );
                        indices[index + 2] = col + 1 + ( row * ( width + 1 ) );

                        indices[index + 3] = indices[index + 2];
                        indices[index + 4] = indices[index + 1];
                        indices[index + 5] = indices[index + 1] + 1;
//                        }
//                       
//                        else{
//                            indices[index] = indices[index-6];
//                            indices[index + 1] = indices[index-5];
//                            indices[index + 2] = indices[index-4];
//
//                            indices[index + 3] = indices[index-3];
//                            indices[index + 4] = indices[index-2];
//                            indices[index + 5] = indices[index-1];
//                        }
                    }
                }

                return indices;
            }