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 (http://www.jpct.net/wiki/index.php/Main_Page#jPCT-AE_-_a_port_of_jPCT_to_Android)
Edit: Fixed link.
Added a HelloWorld for Android to the wiki. It's still lacking documentation though...
added a page for profiling an Android app within and without Eclipse.
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... ???
seems as you havent set debuggable flag on manifest file.
<application .. android:debuggable="true">
...
</application>
Yes, that works better... ;D
The game runs like sh*t when enabling the tracing though...hardly playable at 6 fps... :(
Cool. I've also updated the wiki page.
Yes, profiling slows down the application but hardly noticable on N1. But debugging makes it crawl ::)
Reworked the HelloWorld example in the wiki to make it handle pause/resume better.
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.
You can't port them, because they simply don't exist on Android. At least OpenGL 1.1 doesn't support these features.
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));
/...
I noticed that there is no such class as DeSerializer in jPCT-AE (1.24)...
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) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html#loadSerializedObject(java.io.InputStream))
Thanks for making such a great wiki, and i would love to take part in it.
I'll create an account for you when i'm back home...in a week or so.
You should have received an email with the login data for the wiki.
yes i got it, thank you. ;D
hello
could you please add more comments on the hello-shader sample project.
i couldn't modify it by apply the same shader(in the sample) on any geometry, it keeps rendering weird artifacts.
You need proper normal and height maps for this. Do you have those?
I just replaced the Primitive.getPlane(a,b); by Primitive.getSphete(a,b); in the helloShader project .
result weird artefact.
in other tests I used a 3ds file including a simple geometry (just the geometry no light no camera...)with proper uv mapping ( exported from blender) + texture map , normal map, height map. +provided the shader code .
result : the maps are correctly applied thinks to the texcord but no shader effect , the colors of the textured geometry seem to be a little different( it s like if the light was green)
:o
You can't use a sphere from Primitives for this, because (as the docs say), objects created by the Primitives class have no proper texture coordinates. Load some sphere model that has proper coordinates and it will work.
About the second issue...if everything is green, something is fishy with your textures. It might very well be that the normal or the height map are not in the format that the shader expects. Have a look at the example files to see how they are supposed to look. You can post links to them, if you want to so that we can have a look too.
really sorry to make you wait di long. my DDMS is freezing, it's the same problem no matter what I try. i couldn't take any screenshot. :'(
Hello Egon, I'd also like to contribute to the wiki, if you dont mind. :)
Quote from: BABABLACK_911 on December 28, 2012, 06:24:47 AM
Hello Egon, I'd also like to contribute to the wiki, if you dont mind. :)
You should have received an email from the wiki system....
Thanks a lot Egon, I've activated my account. Also thanks for the prototype projects you sent to me.
I sure will post anything related to jPCT-AE in the wiki.
I have gone in the wiki page and it is empty... is normal ? :'(
No, it's not. But it should actually be fixed more or less by now. See also http://www.jpct.net/forum2/index.php/topic,4191.0.html (http://www.jpct.net/forum2/index.php/topic,4191.0.html)
If it still happens for some pages, you are seeing a cached page. In that case, click on version history and replace the action=history parameter by action=purge. Yes, it's cumbersome, but what should i tell you...it's MediaWiki...