Terrain and Rotated Textures?

I have created two PNG files for generating a terrain based on a heightmap.  The first PNG is a low-resolution heightmap that I scale up in code to be the same size as my texture PNG.  This works fine, however, my texture is rotated 180 degrees from the heightmap when it's rendered.



   protected void simpleInitGame() {
          // This grayscale image will be our terrain
          URL grayscale = atc.class.getClassLoader().getResource("Terrain.png");   
          // Create an image height map based on the gray scale of our image.
          ImageBasedHeightMap ib = new ImageBasedHeightMap(new ImageIcon(grayscale).getImage());
          // This color image will be our texture
          URL colortexture = atc.class.getClassLoader().getResource("Texture.png");
          // Get a TextureState
          TextureState ts = display.getRenderer().createTextureState();
          // Use the TextureManager to load a texture
          Texture t = TextureManager.loadTexture(colortexture, Texture.MM_LINEAR, Texture.FM_LINEAR);
          // Rotate the texture 180 degrees
          t.setRotation()
          // Assign the texture to the TextureState
          ts.setTexture(t);
          // Create a terrain block from the image's grey scale
          TerrainBlock tb = new TerrainBlock("terrain", ib.getSize(), new Vector3f(10f,.5f,10f), ib.getHeightMap(), new Vector3f(0,0,0), false);
          // Give the terrain a bounding box
          tb.setModelBound(new BoundingBox());
          tb.updateModelBound();
          // Texture the terrain
          tb.setRenderState(ts);
          // Attach the terrain to our rootNode.
          rootNode.attachChild(tb);
       }



Did I pooch this up, or should I rotate the texture to line it up with the terrain generated from the heightmap?  If I should rotate it, can someone tell me how to do it?  I'm a noob.

Thanks!  jME rocks!

    Scott

What do you get when you try:



Texture t = TextureManager.loadTexture(colortexture, Texture.MM_LINEAR, Texture.FM_LINEAR, 1.0f, false);


I tried it.  Looks the same.

After some more poking around and toying with my texture image, I've determined that it's not being applied rotated to the terrain, it's actually flipped verticaly.



I'm sure I've done something wrong somewhere.  My brain just doesn't handle 3D very well.  (I'm hoping jME can fix that!)



    Scott

I experienced that to strangely it only seems specific to png even when you flip the texture in your editing gpogram :?