Mohamed Seif
Mohamed Seif

Reputation: 410

min3D is slow in parising loaded OBJ file

The problem is when i load .obj file called canba_obj, then i parse the object, i set a textview with its faces list size, the size is zero.

I discovered that the parsing happens to be very slow, the textview is set before parsing at myParser.parse() finishes.

Here's the code

private static Object3d object3D;
private TextView view;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    IParser myParser = Parser.createParser(Parser.Type.OBJ, getResources(), "com.example.seif.objtoblender:raw/canba_obj", true);
    myParser.parse();

    object3D = myParser.getParsedObject();

    view = (TextView)findViewById(R.id.view1);
    view.setText(object3D.faces().size());

}

Upvotes: 0

Views: 85

Answers (0)

Related Questions