1

I have a blender object and trying to show on the screen on my android phone via min3d,but so far I am getting black blank screen.My object is a simple cube without images. here is the my code

Main Activity

 this.startActivity( new Intent(this,Obj3DView.class));

Obj3DView

public class Obj3DView extends RendererActivity { 

    private Object3dContainer faceObject3D; /** Called when the activity is first created. */ 
    @Override public void initScene() 
    {  

    IParser myParser = Parser.createParser(Parser.Type.OBJ, getResources(), "com.example.opengldenemebir:raw/untitled_obj",true); 
    myParser.parse(); 
    faceObject3D = myParser.getParsedObject(); 
    faceObject3D.position().x =1;
            faceObject3D.position().y =1;
            faceObject3D.position().z = 0; 
    faceObject3D.scale().x = faceObject3D.scale().y = faceObject3D.scale().z = 1.009f;
}

**log cat shows no error

here is the log cat. enter image description here

sakir
  • 3,391
  • 8
  • 34
  • 50
  • I do not know much about min3D. But if it is not working in min3D, you can use [rajawali 3D library](https://github.com/MasDennis/Rajawali). It uses opengl Es 2.0 and has pretty good object parsing APIs. – Abhishek V Jun 01 '14 at 13:50

2 Answers2

0

Try adding light to the scene

Light light = new Light();
scene.lights().add(light);
user2758776
  • 421
  • 1
  • 5
  • 15
0

It might be a little bit late but it can help someone else. I have been working with min3d and I had the same problem, then I found out why I had the black screen :

1) Check the size and position of your object.

2) Check your mtl file Try to use these values :

Ns 96.078431 Ka 1.000000 0.000000 0.000000 Kd 0.640000 0.640000 0.640000 Ks 0.500000 0.500000 0.500000 Ni 1.000000 d 1.000000 illum 2

3) Otherwise check youf file names and links : When you export your objects from Blender, your original file names are for example my_model.obj and my_model.mtl. Loading them on android imposes you have different names (without the extension), try calling them : my_model_obj and my_model_mtl.

The problem with you is maybe because you did not rename the .mtl file inside the .obj file.

Just check the .obj file line mtllib my_model.mtl and replace it by mtllib my_model_mtl

Works fine for me

Souhaib Guitouni
  • 860
  • 1
  • 7
  • 24