T-Shirt Terrain

Okay, bear with me here… you guys have been a huge help so far…



What I wanted was… well… a square chunk of terrain.



Here's the image: ImageShack - Best place for all of your image hosting and image sharing needs



Funky, huh?



I'm using this code along with StandardGame…


public static void genTerrain(Node rootNode, StaticPhysicsNode staticNode) {
HillHeightMap heightMap = new HillHeightMap(129, 2000, 5.0f, 20.0f,
(byte) 2);
heightMap.setHeightScale(0.001f);
Vector3f terrainScale = new Vector3f(10, 1, 10);
TerrainPage terrain = new TerrainPage("Terrain", 33, heightMap
.getSize(), terrainScale, heightMap.getHeightMap(), false);
terrain.setDetailTexture(1, 16);
rootNode.attachChild(terrain);

// Some textures
ProceduralTextureGenerator pt = new ProceduralTextureGenerator(
        heightMap);
    pt.addTexture(new ImageIcon(Notrium.class.getClassLoader()
                                .getResource("resources/grass1ye6.jpg")),
                  -128, 0, 128);
    pt.addTexture(new ImageIcon(Notrium.class.getClassLoader()
                                .getResource("resources/grass2ts7.jpg")),
                  0, 128, 255);
    pt.addTexture(new ImageIcon(Notrium.class.getClassLoader()
                                .getResource("resources/grass3yr9.jpg")),
                  128, 255,
                  384);

    pt.createTexture(256);

TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
ts.setEnabled(true);
Texture t1 = TextureManager.loadTexture(pt.getImageIcon().getImage(),
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR, true);
ts.setTexture(t1, 0);

Texture t2 = TextureManager.loadTexture(Notrium.class
.getClassLoader().getResource("resources/ledleadfd5.jpg"),
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);
ts.setTexture(t2, 1);
t2.setWrap(Texture.WM_WRAP_S_WRAP_T);

t1.setApply(Texture.AM_COMBINE);
t1.setCombineFuncRGB(Texture.ACF_MODULATE);
t1.setCombineSrc0RGB(Texture.ACS_TEXTURE);
t1.setCombineOp0RGB(Texture.ACO_SRC_COLOR);
t1.setCombineSrc1RGB(Texture.ACS_PRIMARY_COLOR);
t1.setCombineOp1RGB(Texture.ACO_SRC_COLOR);
t1.setCombineScaleRGB(1.0f);

t2.setApply(Texture.AM_COMBINE);
t2.setCombineFuncRGB(Texture.ACF_ADD_SIGNED);
t2.setCombineSrc0RGB(Texture.ACS_TEXTURE);
t2.setCombineOp0RGB(Texture.ACO_SRC_COLOR);
t2.setCombineSrc1RGB(Texture.ACS_PREVIOUS);
t2.setCombineOp1RGB(Texture.ACO_SRC_COLOR);
t2.setCombineScaleRGB(1.0f);
rootNode.setRenderState(ts);
staticNode.attachChild( terrain );
staticNode.getLocalTranslation().set( 0, 0, 0);
    }


along with this insertion into the OpenGL thread (it sucks, I know, I'm new at this whole multithread thing)...

private void generateTerrain() {
killText();
final StaticPhysicsNode staticNode = getPhysicsSpace().createStaticNode();
staticNode.setName("terrainNode");
terrain = Utilities.createTerrain();
GameTaskQueueManager.getManager().update(new Callable<Object>() {
public Object call() throws Exception {
staticNode.attachChild( terrain );
staticNode.getLocalTranslation().set( 0, 0, 0);
rootNode.attachChild( staticNode );
dome.setTarget(terrain);
staticNode.generatePhysicsGeometry();
DynamicPhysicsNode dynamicNode = getPhysicsSpace().createDynamicNode();
rootNode.attachChild( dynamicNode );
final Box visualFallingBox = new Box( "falling box", new Vector3f(), 0.5f, 0.5f, 0.5f );
dynamicNode.attachChild( visualFallingBox );
dynamicNode.generatePhysicsGeometry();
dynamicNode.getLocalTranslation().set( 0, 5, 0 );
rootNode.updateGeometricState(0, true);
    rootNode.updateRenderState();

return null;
}
});

}


and I get this error log (no errors... hmmmm)

Feb 7, 2007 2:28:44 AM com.jme.scene.Node <init>
INFO: Node created.
Feb 7, 2007 2:28:44 AM com.jmex.physics.impl.ode.OdePhysicsSpace addNode
INFO: PhysicsNode (null) has been created
Feb 7, 2007 2:28:45 AM com.jmex.terrain.util.HillHeightMap load
INFO: Created Heightmap using the Hill Algorithm
Feb 7, 2007 2:28:45 AM com.jme.scene.Node <init>
INFO: Node created.
Feb 7, 2007 2:28:45 AM com.jme.scene.Node <init>
INFO: Node created.
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage1Block1) attached to this node (TerrainPage1)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage1Block2) attached to this node (TerrainPage1)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage1Block3) attached to this node (TerrainPage1)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage1Block4) attached to this node (TerrainPage1)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage1) attached to this node (Terrain)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node <init>
INFO: Node created.
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage2Block1) attached to this node (TerrainPage2)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage2Block2) attached to this node (TerrainPage2)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage2Block3) attached to this node (TerrainPage2)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage2Block4) attached to this node (TerrainPage2)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage2) attached to this node (Terrain)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node <init>
INFO: Node created.
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage3Block1) attached to this node (TerrainPage3)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage3Block2) attached to this node (TerrainPage3)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage3Block3) attached to this node (TerrainPage3)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage3Block4) attached to this node (TerrainPage3)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage3) attached to this node (Terrain)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node <init>
INFO: Node created.
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage4Block1) attached to this node (TerrainPage4)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage4Block2) attached to this node (TerrainPage4)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage4Block3) attached to this node (TerrainPage4)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage4Block4) attached to this node (TerrainPage4)
Feb 7, 2007 2:28:45 AM com.jme.scene.Node attachChild
INFO: Child (TerrainPage4) attached to this node (Terrain)
Feb 7, 2007 2:28:49 AM com.jme.scene.Node attachChild
INFO: Child (Terrain) attached to this node (terrainNode)
Feb 7, 2007 2:28:49 AM com.jme.scene.Node attachChild
INFO: Child (terrainNode) attached to this node (nheadstate: RootNode)
Feb 7, 2007 2:28:49 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:49 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:49 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:50 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:50 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:50 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:50 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:51 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:51 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:51 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:51 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:51 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:52 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:52 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:52 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:52 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (terrainNode)
Feb 7, 2007 2:28:53 AM com.jme.scene.Node <init>
INFO: Node created.
Feb 7, 2007 2:28:53 AM com.jmex.physics.impl.ode.OdePhysicsSpace addNode
INFO: PhysicsNode (null) has been created
Feb 7, 2007 2:28:53 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (nheadstate: RootNode)
Feb 7, 2007 2:28:53 AM com.jme.scene.Node attachChild
INFO: Child (falling box) attached to this node (null)
Feb 7, 2007 2:28:53 AM com.jmex.physics.PhysicsNode addPhysicsGeometries
INFO: using default model bound for: falling box (com.jme.scene.shape.Box)
Feb 7, 2007 2:28:53 AM com.jme.scene.Node attachChild
INFO: Child (null) attached to this node (null)


Any ideas?
I'm getting nulled out after TerrainPage4, I think, but I dont know why  :?
Should I use the future method-a-ma-thing to block the thread? how?