realBox.setTextures(realBox.getTextures(0), 1);
realBox.copyTextureCoords(0, 1);
  protected void simpleInitGame() {    display.setTitle("Render to Texture");    cam.setLocation(new Vector3f(0, 0, 25));    cam.update();    // Setup dimensions for a box    Vector3f max = new Vector3f(5, 5, 5);    Vector3f min = new Vector3f( -5, -5, -5);    // Make the real world box -- you'll see this spinning around..  woo...    realBox = new Box("Box", min, max);    realBox.setModelBound(new BoundingSphere());    realBox.updateModelBound();    realBox.setLocalTranslation(new Vector3f(0, 0, 0));    rootNode.attachChild(realBox);    // Make a monkey box -- some geometry that will be rendered onto a flat texture.    // First, we'd like the box to be bigger, so...    min.multLocal(3);    max.multLocal(3);    monkeyBox = new Box("Fake Monkey Box", min, max);    monkeyBox.setModelBound(new BoundingSphere());    monkeyBox.updateModelBound();    monkeyBox.setLocalTranslation(new Vector3f(0, 0, 0));    // add the monkey box to a node.  This node is a root node, not part of the "real world" tree.    fakeScene = new Node("Fake node");    fakeScene.attachChild(monkeyBox);    // Setup our params for the depth buffer    ZBufferState buf = display.getRenderer().getZBufferState();    buf.setEnabled(true);    buf.setFunction(ZBufferState.CF_LEQUAL);    fakeScene.setRenderState(buf);    // Lets add a monkey texture to the geometry we are going to rendertotexture...    TextureState ts = display.getRenderer().getTextureState();    ts.setEnabled(true);    ts.setTexture(        TextureManager.loadTexture(        TestRenderToTexture.class.getClassLoader().getResource(        "jmetest/data/images/Monkey.jpg"),        Texture.MM_LINEAR_LINEAR,        Texture.FM_LINEAR,        true));    fakeScene.setRenderState(ts);    // Ok, now lets create the Texture object that our monkey cube will be rendered to.    tRenderer = display.createTextureRenderer(512, 512, false, true, false, false,                                              TextureRenderer.RENDER_TEXTURE_2D,                                              0);    tRenderer.setBackgroundColor(new ColorRGBA(.667f, .667f, .851f, 1f));    fakeTex = tRenderer.setupTexture();    tRenderer.getCamera().setLocation(new Vector3f(0, 0, 75f));    // Now add that texture to the "real" cube.    ts = display.getRenderer().getTextureState();    ts.setEnabled(true);    ts.setTexture(fakeTex, 0);    // Heck, while we're at it, why not add another texture to blend with.    ts.setTexture(        TextureManager.loadTexture(        TestRenderToTexture.class.getClassLoader().getResource(        "jmetest/data/texture/dirt.jpg"),        Texture.MM_LINEAR_LINEAR,        Texture.FM_LINEAR,        true), 1);    rootNode.setRenderState(ts);    // Since we have 2 textures, the geometry needs to know how to split up the coords.    realBox.setTextures(realBox.getTextures(0), 1);    fakeScene.updateGeometricState(0.0f, true);    fakeScene.updateRenderState();  }