Strange behavior with texture wrap on a quad

Hi,



i've a problem with wrapping a texture over a quad.



I have a buildTerrain() method which is called from the initGame() method. The strange thing is, if only call the buildTerrain() method once, only the first tile is textured, and in the same column and row it is kinda blurred. But when i call the method twice or instead my buildPlayer() method accordingly, texture wrapping works fine.



Here is my buildTerrain code:


   private void buildTerrain(){
      Quad field = new Quad("field", 128, 128);
      field.setModelBound(new BoundingBox());
      field.updateModelBound();
      field.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.PI/2,new Vector3f(1,0,0)));
      field.setLightCombineMode(LightState.OFF);
            
           FloatBuffer tBuf = field.getTextureBuffer();
           tBuf.clear();
           tBuf.put(0).put(10);
           tBuf.put(0).put(0);
           tBuf.put(10).put(0);
           tBuf.put(10).put(10);
   
      
      TextureState ts = display.getRenderer().createTextureState();
      ts.setEnabled(true);
      Texture fieldtex = TextureManager.loadTexture(RadicalRacer.class.getClassLoader()
            .getResource("grassb.png"),Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);

      fieldtex.setWrap(Texture.WM_WRAP_S_WRAP_T);
      
      ts.setTexture(fieldtex);
      field.setRenderState(ts);
      scene.attachChild(field);
      scene.updateRenderState();
            
   }



Any ideas?

Greets Av

Edit:
Nobody can help? Or do you need more information?

You might try adding tBuf.rewind() after your puts.  Other than that it seem fine to me…