jME3 terrain

Hey guys -



I am making a game - and the first steps im doing are pretty much prototypes. Whats the best way to get a terrain environment setup and in my game using jME3.



Heightmaps? If so - how do I make one, how do i import one - i dont see any good examples for this in jME3.



Cheers guys,



Andy



**I would want my terrain to support the physicsnode - which i presume is easy!

You can just create a terrain in a modelling tool like Blender3D, you can then export it as an Ogre3D dotScene file and load it. See the TestSceneLoading class for an example.

Ok so I have some terrain - however i dont have a geometry object just a spatial - so how do i make my terrain into a physics node?!



Found it : CollisionShapeFactory.createMeshShape() did the trick.

this work pretty well



        Spatial terrain = (Spatial) assetManager.loadAsset("Models/Terrain.mesh.j3o");
      
        terrain.setShadowMode(ShadowMode.CastAndRecieve);
        Material mat = assetManager.loadMaterial("Models/Terrain.j3m");
        terrain.setMaterial(mat);
        terrain.updateModelBound();
        terrain.updateGeometricState();

        //Making a terrain Physics
        CompoundCollisionShape terrainShape = CollisionShapeFactory.createMeshCompoundShape((Node) terrain);
        PhysicsNode physicsTerrain=new PhysicsNode(terrain,terrainShape,0);
        physicsTerrain.updateModelBound();
        physicsTerrain.updateGeometricState();
        rootNode.attachChild(physicsTerrain);
        getPhysicsSpace().add(physicsTerrain);