sakir
sakir

Reputation: 3502

Blender object show blank screen (Min3d)

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

Upvotes: 1

Views: 317

Answers (2)

Souhaib Guitouni
Souhaib Guitouni

Reputation: 872

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

Upvotes: 0

user2758776
user2758776

Reputation: 431

Try adding light to the scene

Light light = new Light();
scene.lights().add(light);

Upvotes: 0

Related Questions