3D Models and Direction Light ssue in JME3 Canvas within Swing

Hi all,

i have loaded a 3d shoe model in my JME3 Canvas with following code,

[java]myModel = assetManager.loadModel(“/Textures/Shoes/Style_7_Shoe.j3o”);

	Material mat = new Material(assetManager,
			"Common/MatDefs/Light/Lighting.j3md");

	assetManager
			.registerLocator(
					"C:/Documents and Settings/Administrator/Monogenius/5d53e8e5-d242-4aea-b7a6-17e6629300a1",
					FileLocator.class);

	TextureKey dm = new TextureKey("leftShoeTexture.png", true);

	mat.setTexture("DiffuseMap", assetManager.loadTexture(dm));

	myModel.setMaterial(mat);

	rootNode.attachChild(myModel);

	AmbientLight al = new AmbientLight();
	al.setColor(ColorRGBA.White.mult(3.3f));
	rootNode.addLight(al);

	DirectionalLight sun = new DirectionalLight();
	sun.setDirection(new Vector3f(-0.5f, -0.5f, -0.15f).normalizeLocal());
	sun.computeLastDistance(myModel);
	sun.setColor(ColorRGBA.White);
	rootNode.addLight(sun);

[/java]

and i get the look of the model as expected as you can see in the following video.

3D Model in JME3 Canvas with Resolution 1024 X 768 Antialiasing with 4 samples,

[video]http://www.youtube.com/watch?v=-0ePsgUGHzc&feature=youtu.be[/video]

when i load the same model with same materials in my swing canvas after applying translation

leftShoe.setLocalTranslation(new Vector3f(-2.0f, 0.0f, 0.0f));

i get very disappointed view of the shoe, i think there might be lighting problem ,

3D Model in Swing Canvas with Resolution 1024 X 768 Antialiasing with 4 samples,
[video]http://www.youtube.com/watch?v=fYgf0wVRlAA&feature=youtu.be[/video]

all the code are same for the 2 videos , then what is the problem in Swing Canvas ?

why i am not getting expected visualization of the shoe ?

I use SwingCanvas for this project:
https://code.google.com/p/simple-world-editor/

Works perfectly.
You can check with Swing and without.
https://code.google.com/p/simple-world-editor/source/browse/#hg%2Ftrunk%2FSimpleWorldEditor%2Fsrc%2Fcom%2Fswe - here SimpleEditor and SimpleEditorSwing classes.

Just load any model…

Hi

i think this is an issue with lighting , not with the canvas ?
can you check it as well,
i am trying now your suggested link.

Thanks

@mihir said: Hi

i think this is an issue with lighting , not with the canvas ?
can you check it as well,
i am trying now your suggested link.

Thanks

Possibly you added light twice. As models are OverLighten.
Or you did too big values of light.

Hi Paul,

I used same light source in both programs,as i said .

should i paste here complete code ?

Thanks