Hello,
i have a question about JME.
I want to integrate a simple JME "universe" into a swing GUI. Here is the JME Program and everything works fine. I just want to show it in a swing gui, and i dont know how. I read something about the method createCanvas() but when i try to integrate that canvas in a swing gui, i cant see anything.
It'll be nice to see an example code of how i can show my JME Programm in swing GUI.
Excuse my bad engilish
public static void main( String[] args ){
new FinalIsland();
}
protected void simpleInitGame()
{
display.setTitle( "Final Island" );
// set up the scene graph
Node terrainScene = new Node( "terrainScene" );
// create the skybox
skybox = new SkyBox( terrainScene, cam.getLocation() );
// create the terrain
terrain = new Terrain( terrainScene );
// create the water
water = new Water( terrainScene, 39.7147f );
// create a jeep
jeep = new Jeep( terrainScene );
jeep.setPosition( new Vector3f( 167, terrain.getHeightAt( 167, 190 ), 190 ) );
// simulate a sun
LightState ls = display.getRenderer().createLightState();
DirectionalLight light = new DirectionalLight();
light.setDirection( new Vector3f( 0.6f, -0.75f, 0.6f ) );
float intensity = 1.0f;
light.setDiffuse( new ColorRGBA( intensity, intensity, intensity, 1.0f ) );
light.setAmbient( new ColorRGBA( intensity, intensity, intensity, 1.0f ) );
light.setEnabled( true );
ls.attach( light );
terrainScene.setRenderState( ls );
// switch of the standard light
lightState.detachAll();
// attach the whole scene and update the render states
rootNode.attachChild( terrainScene );
rootNode.updateRenderState();
// move the camera to the middle of the island
cam.setLocation( new Vector3f( 150, 80, 180 ) );
}