Hi,
I am creating a sample AR App on android. I am trying to render the .obj model over the camera surface. The model is rendered but whole part of it is Black color when there is no texture for the relevant obj. When the model is assigned with texture, couldn’t see the texture over the model and error occurs.
Asset folder contains
Box_Image2.obj
Box_Image2.mtl
pixels.jpeg (texture image of box)
1st try was .
Spatial cube = assetManager.loadModel(“Models/Ninja/Box_Image2.obj”);
cube.scale(0.025f, 0.025f, 0.025f);
cube.rotate(0.0f, -3.0f, 0.0f);
cube.setLocalTranslation(0.0f, -2.5f, 0.0f);
rootNode.attachChild(cube);
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(sun);
2nd try was
Material mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
Spatial cube = assetManager.loadModel(“Models/Ninja/Box_Image2.obj”);
cube.scale(0.025f, 0.025f, 0.025f);
cube.rotate(0.0f, -3.0f, 0.0f);
cube.setLocalTranslation(0.0f, -2.5f, 0.0f);
mat.setTexture("ColorMap", getAssetManager().loadTexture("Models/Ninja/pexels.jpeg"));
cube.setMaterial(mat);
rootNode.attachChild(cube);
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(sun);
in both scenario error was occurred as below
com.jm3.asset.AssetLoadException: An exception has occurred while loading asset
Exception thrown in Thread[GLThread3291,5,main] com.jme3asset.AssetLoadException : An exception has occurred while loading asset: Models/Ninja/pexels.jpeg(Flipped)(Mipmaped)
Please find the attached image
I compiling on Android 25(7 - Nougat), jme-3.1.0 Stable version.