* Put arrow texture on alien, generate axis for each vertex
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8576 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
0e49c439b7
commit
83ab68264b
@ -36,11 +36,12 @@ public class TestTangentGenBadModels extends SimpleApplication {
|
|||||||
assetManager.registerLocator("http://jme-glsl-shaders.googlecode.com/hg/assets/Models/LightBlow/", UrlLocator.class);
|
assetManager.registerLocator("http://jme-glsl-shaders.googlecode.com/hg/assets/Models/LightBlow/", UrlLocator.class);
|
||||||
assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/", UrlLocator.class);
|
assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/", UrlLocator.class);
|
||||||
|
|
||||||
Spatial badModel = assetManager.loadModel("jme_lightblow.obj");
|
Geometry badModel = (Geometry) assetManager.loadModel("jme_lightblow.obj");
|
||||||
badModel.setLocalScale(2f);
|
badModel.setLocalScale(2f);
|
||||||
|
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
|
// Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
|
||||||
mat.setTexture("NormalMap", assetManager.loadTexture("jme_lightblow_nor.png"));
|
// mat.setTexture("NormalMap", assetManager.loadTexture("jme_lightblow_nor.png"));
|
||||||
|
Material mat = assetManager.loadMaterial("Textures/BumpMapTest/Tangent.j3m");
|
||||||
badModel.setMaterial(mat);
|
badModel.setMaterial(mat);
|
||||||
rootNode.attachChild(badModel);
|
rootNode.attachChild(badModel);
|
||||||
|
|
||||||
@ -55,25 +56,25 @@ public class TestTangentGenBadModels extends SimpleApplication {
|
|||||||
Mesh m = g.getMesh();
|
Mesh m = g.getMesh();
|
||||||
Material mat = g.getMaterial();
|
Material mat = g.getMaterial();
|
||||||
|
|
||||||
if (mat.getParam("DiffuseMap") != null){
|
// if (mat.getParam("DiffuseMap") != null){
|
||||||
mat.setTexture("DiffuseMap", null);
|
// mat.setTexture("DiffuseMap", null);
|
||||||
}
|
// }
|
||||||
TangentBinormalGenerator.generate(m);
|
TangentBinormalGenerator.generate(m);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Geometry debug = new Geometry(
|
Geometry debug = new Geometry(
|
||||||
// "Debug Teapot",
|
"Debug Teapot",
|
||||||
// TangentBinormalGenerator.genTbnLines(((Geometry) badModel).getMesh(), 0.03f)
|
TangentBinormalGenerator.genTbnLines(((Geometry) badModel).getMesh(), 0.03f)
|
||||||
// );
|
);
|
||||||
// debug.getMesh().setLineWidth(3);
|
debug.getMesh().setLineWidth(3);
|
||||||
|
|
||||||
// Material debugMat = assetManager.loadMaterial("Common/Materials/VertexColor.j3m");
|
Material debugMat = assetManager.loadMaterial("Common/Materials/VertexColor.j3m");
|
||||||
// debug.setMaterial(debugMat);
|
debug.setMaterial(debugMat);
|
||||||
// debug.setCullHint(Spatial.CullHint.Never);
|
debug.setCullHint(Spatial.CullHint.Never);
|
||||||
// debug.getLocalTranslation().set(badModel.getLocalTranslation());
|
debug.getLocalTranslation().set(badModel.getLocalTranslation());
|
||||||
// debug.getLocalScale().set(badModel.getLocalScale());
|
debug.getLocalScale().set(badModel.getLocalScale());
|
||||||
// rootNode.attachChild(debug);
|
rootNode.attachChild(debug);
|
||||||
|
|
||||||
DirectionalLight dl = new DirectionalLight();
|
DirectionalLight dl = new DirectionalLight();
|
||||||
dl.setDirection(new Vector3f(-0.8f, -0.6f, -0.08f).normalizeLocal());
|
dl.setDirection(new Vector3f(-0.8f, -0.6f, -0.08f).normalizeLocal());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user