jPCT-AE - a 3d engine for Android > Support

Object loading

(1/2) > >>

amrish90:
I am new to JPCT-AE. I am able to load the 3D object but it is taking a lot of time. I want to show a progress dialog till the 3d object is loaded. Can anyone help me with this issue or to increase the performance.

EgonOlsen:
Which file format are you using and how big is this model?

amrish90:
I am loading .obj format and .mtl file... The file size is approx. 3mb...

amrish90:
I am working on Augmented Reality Project. Here i need to load the 3Dobject over the camera preview. The object is taking time to load so i require a progress dialog. Can anyone help me for this..

Irony:
You can load your objects in a new thread and meanwhile, show a blinking "Loading" message or whatever on your main thread.

So, if you had a function like that before


--- Code: ---
private void initObjects() {
// ...load your objects
}

--- End code ---

you can add another class (even in the same source file for convenience)


--- Code: ---class InitObject extends Thread {

public void run() {
loading=true;
// ...load your objects
                loading=false;
        }
--- End code ---

and change initObjects() to


--- Code: ---private void initObjects() {
    InitObject i = new InitObject();
    i.start();
}

--- End code ---


and check for "loading" in the render thread. Something like that.



   

Navigation

[0] Message Index

[#] Next page

Go to full version