www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: nico_r_a on July 21, 2011, 09:50:18 am

Title: load a .obj file in JPCT-AE demo
Post by: nico_r_a on July 21, 2011, 09:50:18 am
Hello!!
I would like to load a .obj file in JPCT-AE.
I have read all the topics in relation with my question but i haven't found an answer.
So, how should i do to load .obj file in the demo JPCT-AE.

thank you very much

sorry for the mistakes, but i am french
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 21, 2011, 11:13:59 am
There's a Loader-class for loading OBJ-files. Copy your obj-file (and the mtl-file if needed) into the res/raw-folder of your project and use the Loade.loadOBJ(...) method to load it. Keep in mind that Android limits the file size based on the extension. So if your obj-file is too large (>1mb), you might want to zip it and load it via a ZipInputStream or rename it to .mp3 (no restrictions apply for that extension).
In addition, it may be required to scale and/or translate the model to make it appear correctly in the demo. For loading textured models, please refer to the wiki: http://www.jpct.net/wiki/index.php/Loading_models (http://www.jpct.net/wiki/index.php/Loading_models)
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on July 21, 2011, 11:54:04 am
thank you for the reply
actually my mtl et obj are in differrent folders.
Should i change the way to texture in the obj et mtl if i add the mtl et obj in (res/raw)??
if yes, what should the software be used to open the mtl and obj??

and my .obj do 3.5Mo so i must change this extension in .mp3?
 and where should i copy the command Loade.loadOBJ(...)??
and i put the way in the (...)?
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 21, 2011, 03:02:21 pm
Well...maybe you should start reading and understanding the docs: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html)
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on July 22, 2011, 03:09:28 pm
i have seen your link,
but there aren't information on the large of my obj file.
what should i do with my obj file if his large is 3.5Mo?

and actually i have a folder with files
.obj
.mtl
.mb
.ma
.fbx
.dxf
.dae
what file should i use to create a 3d wih android please?
thank you
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 22, 2011, 07:47:52 pm
You need obj and mtl. If the file is too large, rename to .mp3 as a quick and dirty solution. However, loading a 3.5Mb OBJ file into Android might not be the best idea ever. What kind of model is that? Isn't it possible to reduce the polygon count?
Title: Re: load a .obj file in JPCT-AE demo
Post by: sienioslaw on July 26, 2011, 12:40:24 am
Hello! I'm new one to this forum, and I also have problem with loading obj models...
Here is some info: I'm using Eclipse and Android SDK 2.1
I'm following this tutorial: http://www.jpct.net/wiki/index.php/Loading_3ds_Models_from_Blender - only changed loading function from 3ds into OBJ(as far I understood from doc's, I don't need mtl, so left it null),
I put my model, a example file from http://people.sc.fsu.edu/~jburkardt/data/obj/obj.html in 'assets' folder

Tried to test it on emulator but crashing like hell  :-\ and looks like it's OutOfMemory problem, but how if I only load simple cube file? 

Here is code and log:
source:
Code: [Select]
package com.threed.jpct.example;

import java.io.*;
import java.lang.reflect.Field;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.opengles.GL10;

import android.app.Activity;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.MotionEvent;


import com.threed.jpct.*;
import com.threed.jpct.util.BitmapHelper;
import com.threed.jpct.util.MemoryHelper;
/**
 * A simple demo. This shows more how to use jPCT-AE than it shows how to write
 * a proper application for Android.
 * It includes basic activity management to handle pause and resume...
 *
 * @author EgonOlsen
 *
 */
public class HelloWorld extends Activity {
    private String thingName = "temp";
    private int thingScale = 1;//end
private static HelloWorld master = null;

private GLSurfaceView mGLView;
private MyRenderer renderer = null;
private FrameBuffer buffer = null;

private World world = null;
private RGBColor back = new RGBColor(50, 50, 100);

private float touchTurn = 0;
private float touchTurnUp = 0;

private float xpos = -1;
private float ypos = -1;

private Object3D thing = null;
private int fps = 0;

private Light sun = null;
private Camera cam = null;

AssetManager assMan;
InputStream is;
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
mGLView = new GLSurfaceView(getApplication());
renderer = new MyRenderer();
mGLView.setRenderer(renderer);
setContentView(mGLView);
}

@Override
protected void onPause() {
super.onPause();
mGLView.onPause();
}

@Override
protected void onResume() {
super.onResume();
mGLView.onResume();
}

protected void onStop() {
super.onStop();
}

public boolean onTouchEvent(MotionEvent me) {

if (me.getAction() == MotionEvent.ACTION_DOWN) {
xpos = me.getX();
ypos = me.getY();
return true;
}

if (me.getAction() == MotionEvent.ACTION_UP) {
xpos = -1;
ypos = -1;
touchTurn = 0;
touchTurnUp = 0;
return true;
}

if (me.getAction() == MotionEvent.ACTION_MOVE) {
float xd = me.getX() - xpos;
float yd = me.getY() - ypos;

xpos = me.getX();
ypos = me.getY();

touchTurn = xd / -100f;
touchTurnUp = yd / -100f;
return true;
}

try {
Thread.sleep(15);
} catch (Exception e) {
// No need for this...
}

return super.onTouchEvent(me);
}

protected boolean isFullscreenOpaque() {
return true;
}

class MyRenderer implements GLSurfaceView.Renderer {

private long time = System.currentTimeMillis();
private boolean stop = false;

public MyRenderer() {
}

public void stop() {
stop = true;
}

public void onSurfaceChanged(GL10 gl, int w, int h) {
if (buffer != null) {
buffer.dispose();
}
buffer = new FrameBuffer(gl, w, h);

if (master == null) {

world = new World();
        world.setAmbientLight(150, 150, 150);

sun = new Light(world);
sun.setIntensity(250, 250, 250);

thing = loadModel("assets/model.obj", thingScale);
        thing.build();

world.addObject(thing);

cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
cam.lookAt(thing.getTransformedCenter());

SimpleVector sv = new SimpleVector();
sv.set(thing.getTransformedCenter());
sv.y -= 100;
sv.z -= 100;
sun.setPosition(sv);
//MemoryHelper.compact();

if (master == null) {
Logger.log("Saving master Activity!");
master = HelloWorld.this;
}
}
}

public void onSurfaceCreated(GL10 gl, EGLConfig config) {
}

public void onDrawFrame(GL10 gl) {

try {
if (!stop) {
if (touchTurn != 0) {
thing.rotateY(touchTurn);
touchTurn = 0;
}

if (touchTurnUp != 0) {
thing.rotateX(touchTurnUp);
touchTurnUp = 0;
}

buffer.clear(back);
world.renderScene(buffer);
world.draw(buffer);
buffer.display();

if (System.currentTimeMillis() - time >= 1000) {
Logger.log(fps + "fps");
fps = 0;
time = System.currentTimeMillis();
}
fps++;
} else {
if (buffer != null) {
buffer.dispose();
buffer = null;
}
}
} catch (Exception e) {
Logger.log(e, Logger.MESSAGE);
}
}

    private Object3D loadModel(String filename, float scale) {
assMan = getResources().getAssets();
is = new InputStream() {
@Override
public int read() throws IOException {
return 0;
}
};
        Object3D[] model = Loader.loadOBJ(is, null, scale);
        Object3D o3d = new Object3D(0);
        Object3D temp = null;
        for (int i = 0; i < model.length; i++) {
            temp = model[i];
            temp.setCenter(SimpleVector.ORIGIN);
            temp.rotateX((float)( -.5*Math.PI));
            temp.rotateMesh();
            temp.setRotationMatrix(new Matrix());
            o3d = Object3D.mergeObjects(o3d, temp);
            o3d.build();
        }
        return o3d;
    }
}
}




log:
Code: [Select]
07-25 22:33:48.269: WARN/ActivityManager(65): Activity idle timeout for HistoryRecord{44ffd098 com.threed.jpct.example/.HelloWorld}
07-25 22:33:48.549: INFO/dalvikvm-heap(466): Grow heap (frag case) to 13.402MB for 6378722-byte allocation
07-25 22:33:51.678: INFO/dalvikvm-heap(466): Forcing collection of SoftReferences for 9568078-byte allocation
07-25 22:33:51.798: ERROR/dalvikvm-heap(466): Out of memory on a 9568078-byte allocation.
07-25 22:33:51.798: INFO/dalvikvm(466): "GLThread 8" prio=5 tid=7 RUNNABLE
07-25 22:33:51.809: INFO/dalvikvm(466):   | group="main" sCount=0 dsCount=0 s=N obj=0x44e85270 self=0x11f848
07-25 22:33:51.809: INFO/dalvikvm(466):   | sysTid=472 nice=0 sched=0/0 cgrp=default handle=1283576
07-25 22:33:51.809: INFO/dalvikvm(466):   | schedstat=( 10442697916 807643615 403 )
07-25 22:33:51.828: INFO/dalvikvm(466):   at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:~97)
07-25 22:33:51.828: INFO/dalvikvm(466):   at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:157)
07-25 22:33:51.838: INFO/dalvikvm(466):   at java.lang.StringBuffer.append(StringBuffer.java:215)
07-25 22:33:51.838: INFO/dalvikvm(466):   at com.threed.jpct.Loader.loadBinaryFile(Loader.java:1076)
07-25 22:33:51.850: INFO/dalvikvm(466):   at com.threed.jpct.Loader.loadTextFile(Loader.java:71)
07-25 22:33:51.850: INFO/dalvikvm(466):   at com.threed.jpct.Loader.loadOBJ(Loader.java:302)
07-25 22:33:51.850: INFO/dalvikvm(466):   at com.threed.jpct.Loader.loadOBJ(Loader.java:207)
07-25 22:33:51.858: INFO/dalvikvm(466):   at com.threed.jpct.example.HelloWorld$MyRenderer.loadModel(HelloWorld.java:218)
07-25 22:33:51.858: INFO/dalvikvm(466):   at com.threed.jpct.example.HelloWorld$MyRenderer.onSurfaceChanged(HelloWorld.java:148)
07-25 22:33:51.878: INFO/dalvikvm(466):   at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1325)
07-25 22:33:51.878: INFO/dalvikvm(466):   at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
07-25 22:33:51.928: INFO/ActivityManager(65): Displayed activity com.threed.jpct.example/.HelloWorld: 14353 ms (total 418702 ms)
07-25 22:33:51.958: WARN/dalvikvm(466): threadid=7: thread exiting with uncaught exception (group=0x4001d800)
07-25 22:33:52.078: ERROR/AndroidRuntime(466): FATAL EXCEPTION: GLThread 8
07-25 22:33:52.078: ERROR/AndroidRuntime(466): java.lang.OutOfMemoryError
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:97)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:157)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at java.lang.StringBuffer.append(StringBuffer.java:215)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at com.threed.jpct.Loader.loadBinaryFile(Loader.java:1076)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at com.threed.jpct.Loader.loadTextFile(Loader.java:71)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at com.threed.jpct.Loader.loadOBJ(Loader.java:302)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at com.threed.jpct.Loader.loadOBJ(Loader.java:207)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at com.threed.jpct.example.HelloWorld$MyRenderer.loadModel(HelloWorld.java:218)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at com.threed.jpct.example.HelloWorld$MyRenderer.onSurfaceChanged(HelloWorld.java:148)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1325)
07-25 22:33:52.078: ERROR/AndroidRuntime(466):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
07-25 22:33:52.168: WARN/ActivityManager(65):   Force finishing activity com.threed.jpct.example/.HelloWorld

Any advices?
Btw. Sorry for my english...
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 26, 2011, 10:20:01 am
You've coded that OutOfMemory-Exception all by yourself. Why are you creating an InputStream that does nothing but constantly writes 0 into the stream? This can't lead to anywhere else but an OutOfMemory. Simply load it like this:

Code: [Select]
cube=Object3D.mergeAll(Loader.loadOBJ(getResources().getAssets().open("cube.obj"), null, 20));
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on July 28, 2011, 11:06:27 am
ok, but when i put the file .mp3 in my raw, le file R.java doesn't update.
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 28, 2011, 11:38:22 am
Press f5 on the project in Eclipse.
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on July 28, 2011, 11:49:06 am
i have already tried and don't update
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 28, 2011, 12:17:15 pm
It's an Eclipse issue. I have this problem myself from time to time. Try to erstattet Eclipse or do a clean on the project.
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on July 28, 2011, 02:03:44 pm
i have another problem now.
in my .obj i don't have the link with my texture.
how can i do to create a link between the texture and the object?
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 28, 2011, 08:03:50 pm
http://www.jpct.net/wiki/index.php/Loading_models (http://www.jpct.net/wiki/index.php/Loading_models)
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on July 29, 2011, 10:30:50 am
but i don't understand, i have downloaded deep exploration 5.06. But what should i do with the texture??
i don't understant the link between the code java in eclipse and the deep exploration

and can i do a effect transparency on a object??

I know that my questions are bad level but i am beginner.
thank you
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 29, 2011, 05:53:04 pm
It's not about your questions being beginner questions...that's perfectly fine. I just get the feeling, that you aren't really reading the docs...anyway...this has nothing to do with DeepExploration. It's just an example and the only viewer program that i own, which is why i used that. What you need (and DE can help you with that) are the names of the textures in the file. You then load a texture and add it using the exact same name to the TextureManager. When loading your object, the loader will assign this texture to the corresponding polygons based on this name. Then again, that's what the wiki page has already said... ???

Transparency can be taken from the file or set in code by using...setTransparency(...).
Title: Re: load a .obj file in JPCT-AE demo
Post by: RhoX on July 29, 2011, 08:29:09 pm
Hey folks,

I was reading those posts about the .OBJ models loading  and I tried the following code in my app:

Code: [Select]
for (int i = 0; i < model.length; i++) {
            temp = model[i];
            temp.setCenter(SimpleVector.ORIGIN);
            temp.rotateX((float)( -.5*Math.PI));
            temp.rotateMesh();
            temp.setRotationMatrix(new Matrix());
            o3d = Object3D.mergeObjects(o3d, temp);
            o3d.build();

I suppose its purpose is position the models correctly at the scene [based on another topic]. But, with me, it didn't work (the objects are still at the wrong positions). Some suggestions?

Thanks!
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on July 29, 2011, 11:01:09 pm
This hasn't much to do with positioning. It's just to compensate for the different coordinate systems. What do you mean with "wrong positions"? The loader is for loading the objects, not for loading a scene setup. I'm not even sure if that is actually part of the OBJ-format...
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 01, 2011, 11:44:01 am
thank you, I read your docs wiki but like i am french i don't understant all , I am working on your advice.
But can i optimize the time to run the application android. Because i must to wait 15 minutes in each time. Is there a solution??

Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 01, 2011, 11:50:30 am
Wait 15 min...for what exactly? For loading the models?
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 01, 2011, 11:52:09 am
yes when i am with the emulator, i run the application and i must to wait 15 minutes to see the scene (my file obj)
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 01, 2011, 12:21:34 pm
How large is that object? Loading obj-files isn't particularly fast on Android and even slower in the emulator (also depends on the underlying PC hardware), which is why jPCT-AE introduced serialized obects which are loaded with the desktop version and stored in an Android friendly format. However, your file seems to be rather large... :o
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 01, 2011, 01:44:35 pm
my file is 3.5Mo, is there a solution? and my obj is in ASCII
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 01, 2011, 01:54:47 pm
Can you send me that object file for testing? The basic solution is to load the object in desktop JPCT and save it in an optimized format and load that in Android. You'll find information on that in the wiki and in this forum. However, i would like to see for myself why it is THAT slow.
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 01, 2011, 02:01:02 pm
sorry, but i can't send this file obj. I can really not. it's my subject of training
but in 3ds it s fastest??
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 01, 2011, 04:09:28 pm
...that makes it difficult to help you in that particular case. I'm not even sure if your model is in OBJ-format (which is an ASCII based format) or in ASC (which is another ASCII based format)...if loading OBJ takes 15min, loading 3DS won't be much faster...even if it would be 5 times as fast, it would still take 3min to load. I only can repeat myself:

Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 01, 2011, 04:22:27 pm
where do i get the log??
and i don't understand serialized?? because me, my obj file is a scene.
How can i convert .obj in 3ds??  please

In more another question with my camera, my scene was in reverse, i have done a rotation and the camera are always in reverse, to see the scene correctly i must execute a rotation on the camera and a rotation on the scene but i lose my postition for the camera.
Do you understand this new problem?

Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 01, 2011, 08:23:03 pm
You are developing for Android without knowing where to find the logcat output?  :o It's available in the DDMS perspective in Eclipse. You should really check out your tools...

Serialized objects are briefly described in the wiki link that i gave you. Another desription: http://www.jpct.net/forum2/index.php/topic,1578.msg11888.html#msg11888 (http://www.jpct.net/forum2/index.php/topic,1578.msg11888.html#msg11888)
jPCT doesn't care about "scenes"...for the loader, your OBJ-file is just a bunch of objects, which is why the loader returns an array of Object3D. You can either (de)serialize single objects or arrays of objects.

You can convert obj to 3ds with any tool that can do that. DeepExploration for example. If you still have that, give it a try.

I'm not sure what you mean with "in reverse". The coordinate system between jPCT and your editor may differ. Usually, a obj.rotateX((float) (-.5 * Math.PI)); should rotate the scene correctly. As said above, there is no "scene loading"...it just loads the objects from the file. The camera will remain default, unless you are changing it (i.e. located at the origin looking down the positive z-axis). 
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 02, 2011, 09:44:09 am
but i asked this question because on the wiki I do not understand everything (because i am french ^^)
"in reverse" is to mean the scene is turn up (upside down), i must turn my head of 180 degré to see correctly the scene.
so i do always a rotate?
i have try to turn the obj but it's not correct



i have convert my file obj in 3ds but i don't arrive to load :
''private Object loadModel(InputStream filename, float scale) {
         Object3D[] model = Loader.load3DS(filename, scale);"
 this is correct??


i wish to serialiaze my object. in your demo there is a file .ser. how do you create this file?
thank you
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 02, 2011, 04:14:40 pm
The rotation of the model after loading depends on how it has been stored in the file. In most cases, you have to rotate it -90 (Pi/2) degrees around x. In your case, it seems that you have to rotate it 180 degrees (Pi). It's always better to rotate the mesh instead of rotating the camera, because its more difficult to work with a camera that it upside-down. What do you mean by "not correct". The rotation itself IS correct. It might happen that the rotation pivot (i.e. the point around which the rotation happens in object space) is not what you expect it to be. It's calculated by jPCT when calling build(). If it's different for your model, you might have to adjust it. Just play around with rotations and translation to get it right.

Your loading code is correct as long as filename really is a valid inputstream. What the problem with loading it that way?

About serialization...i can't say more about that it than i did in the link that i already gave you: http://www.jpct.net/forum2/index.php/topic,1578.msg11888.html#msg11888 (http://www.jpct.net/forum2/index.php/topic,1578.msg11888.html#msg11888). Remember that you need the desktop version of jPCT to do this.
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 02, 2011, 04:23:48 pm
ok thank you, it's great i have done a rotation of 90 and it is better.

the problem with the 3ds is that when i launch the application in the emulator, after 30min there is nothing.
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 02, 2011, 04:29:34 pm
I...need...that...file...or some other file that shows similar behaviour on your machine. Without that, i can't tell what the problem is. My guess is, that the machine you are using for development is dog slow...what are you using (CPU, Mhz, memory, OS...)?
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 02, 2011, 04:34:16 pm
BTW: DDMS and Logcat:

(http://jpct.de/pix/ddms.jpg)
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 02, 2011, 04:44:18 pm
i have a intel core 2 duo E7400
2.8Ghz
with 3.5Go RAM

and how do you extract the logcat? because i can copy the text.

but i have test on the mobile android and it s low very low too
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 02, 2011, 04:47:36 pm
and in the logcat there are information on my file obj. so sorry but i can't give this
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 02, 2011, 04:51:01 pm
Then, i'm afraid, i can't help. My guess is, that the mesh's complexity is simply beyond anything that is feasible on a mobile device, but i can't be sure if i don't have the file nor the log output. Can you at least tell me about the polygon/vertex count of that monster file?

Which device have you used for testing?
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 02, 2011, 04:54:48 pm
a acer stream

and i have 14000 vertices
and 15000 faces
so it's lot?
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 02, 2011, 05:18:44 pm
It's not small, but it shouldn't be a problem either. It tried to load this one: http://jpct.de/download/tmp/hose_poser.obj (http://jpct.de/download/tmp/hose_poser.obj)...it loads in a few seconds on the Nexus S and displays fine. Maybe you are having some OutOfMemory or other error and are just not noticing it...so that you wait for something that never happens? Please try that test object instead of yours to see what happens. If it works ok, try to serialize your object with desktop jPCT and load that one.
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 02, 2011, 05:30:58 pm
but my file obj have 80 objects
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 02, 2011, 09:01:02 pm
So be it. What am i supposed to do now? Switch off the magic "sleep-30min-if-the-file-contains-dozens-of-objects"-switch? I don't have that file, i don't have that log, i don't have a test case. I'm as much stuck as you are.
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 03, 2011, 09:16:33 am
ok, but i can t give this file
thank you for the advices, i am going to try to improve my file.

i can convert my file in 3ds but are there another type which is better to load in the android?
and can you help me on the question who are on this topic please "Re: How can I serialize a mesh?"
Title: Re: load a .obj file in JPCT-AE demo
Post by: nico_r_a on August 04, 2011, 02:15:48 pm
i have this in my console
[2011-08-04 14:19:07 - file4] res\raw\scene.mtl:0: error: Resource entry scene is already defined.
[2011-08-04 14:19:07 - file4] res\raw\scene.3ds:0: Originally defined here.
[2011-08-04 14:19:07 - file4] res\raw\tempera.mtl:0: error: Resource entry tempera is already defined.
[2011-08-04 14:19:07 - file4] res\raw\tempera.3ds:0: Originally defined here.
what shoud i do?
Title: Re: load a .obj file in JPCT-AE demo
Post by: EgonOlsen on August 04, 2011, 02:23:03 pm
You can't have multiple ressource with the name name before the suffix. Please learn how to use your tools.