jPCT-AE wiki

Started by EgonOlsen, June 24, 2010, 11:21:56 PM

Previous topic - Next topic

EgonOlsen

I started to write some stuff about AE in a section of the wiki. Until now, it contains some blah about the differences (not very detailed) and some performance tips. Contributions are always welcome: http://www.jpct.net/wiki/index.php/Main_Page#jPCT-AE_-_a_port_of_jPCT_to_Android

Edit: Fixed link.

EgonOlsen

Added a HelloWorld for Android to the wiki. It's still lacking documentation though...

raft

added a page for profiling an Android app within and without Eclipse.

EgonOlsen

Too bad that this doesn't work on 1.5 and/or my phone. The result when trying this on the command line is this:


08-06 21:15:37.474: ERROR/AndroidRuntime(12036): Uncaught handler: thread main exiting due to uncaught exception
08-06 21:15:37.474: ERROR/AndroidRuntime(12036): *** EXCEPTION IN SYSTEM PROCESS.  System will crash.
08-06 21:15:37.494: ERROR/AndroidRuntime(12036): java.lang.SecurityException: Process not debuggable: ProcessRecord{43734168 11894:com.threed.jpct.games.alienrunner/10092}
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at android.os.Parcel.readException(Parcel.java:1234)
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at android.os.Parcel.readException(Parcel.java:1222)
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at android.app.ActivityManagerProxy.profileControl(ActivityManagerNative.java:2156)
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at com.android.commands.am.Am.runProfile(Am.java:455)
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at com.android.commands.am.Am.run(Am.java:79)
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at com.android.commands.am.Am.main(Am.java:51)
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at com.android.internal.os.RuntimeInit.finishInit(Native Method)
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:186)
08-06 21:15:37.494: ERROR/AndroidRuntime(12036):     at dalvik.system.NativeStart.main(Native Method)


All i find when searching for this exception is the source code of Donut, i.e. Android 1.6...obviously, nobody else has this problem... ???

raft

seems as you havent set debuggable flag on manifest file.


<application .. android:debuggable="true">
   ...
</application>

EgonOlsen

Yes, that works better... ;D

The game runs like sh*t when enabling the tracing though...hardly playable at 6 fps...  :(

raft

Cool. I've also updated the wiki page.

Yes, profiling slows down the application but hardly noticable on N1. But debugging makes it crawl ::)

EgonOlsen

Reworked the HelloWorld example in the wiki to make it handle pause/resume better.

Sushil

Quote from: EgonOlsen on November 24, 2010, 11:28:14 PM
Reworked the HelloWorld example in the wiki to make it handle pause/resume better.

Hi,

Can you please post the Android version of Advanced example posted in Wiki. I was trying to port the advanced example to android but not able to import Projector, ShadowHelper and few other things. Can you suggest me what should I do? Currently I am just using jpect_ae.jar in my build. I have just started to use JPECT engine two days back.

Thank you for posting the HelloWorld example for android.

EgonOlsen

You can't port them, because they simply don't exist on Android. At least OpenGL 1.1 doesn't support these features.

redfalcon

I thought I share my simple implementation of the serializer (for *.obj and *.mtl files) for the Android version, might be useful for others. If you don't mind, you can add it to the wiki.
I expected worse when I read that "It's a bit painful to use right now"  ;) It has no special error checking etc., but its usable and should be quickly adaptable for other filetypes.


import java.io.FileOutputStream;
import com.threed.jpct.DeSerializer;
import com.threed.jpct.Loader;
import com.threed.jpct.Object3D;

public class Serializer {

              //Adjust the paths as necessary
private static final String INPUT_MODEL = "c:/myobj.obj";
private static final String INPUT_MATERIAL = "c:/mymtl.mtl";
private static final String OUTPUT_FILE = "c:/serialized.obj";

public static void main(String[] args) {

Object3D[] objs = null;
objs = Loader.loadOBJ(INPUT_MODEL, INPUT_MATERIAL, 1);

for (Object3D o : objs)
o.build();

DeSerializer ds = new DeSerializer();

try {

FileOutputStream baos = new FileOutputStream(OUTPUT_FILE);
ds.serializeArray(objs, baos, true);

} catch (Exception e) {

e.printStackTrace();
}

}

}


Load in jpct-ae with:


/...
Object3D[] serializedObject = null;
serializedObject = Loader.loadSerializedObjectArray(res.openRawResource(R.raw.INSERT_FILE_NAME));
/...

yindroid

I noticed that there is no such class as DeSerializer in jPCT-AE (1.24)...

EgonOlsen

No, it hasn't. That's because it makes no sense to serialize objects on Android directly. The idea is to serialize them using the desktop version and then load them via http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html#loadSerializedObject(java.io.InputStream)

OneManSitting

Thanks for making such a great wiki, and i would love to take part in it.

EgonOlsen

I'll create an account for you when i'm back home...in a week or so.