Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - haijin

Pages: 1 [2] 3
16
Support / Re: serialization for Object3D
« on: May 31, 2011, 11:46:05 pm »
now I get a java.io.NotSerializableException: com.threed.jpct.Object3DCompiler

17
Support / Re: serialization for Object3D
« on: May 31, 2011, 11:37:22 pm »
whops, my mistake... the old jar (renamed) was still intefering...

18
Support / Re: serialization for Object3D
« on: May 31, 2011, 11:31:32 pm »
I replaced the library but I'm getting an error with MemoryHelper:

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/threed/jpct/util/MemoryHelper;

... even after restarting the IDE

19
Support / serialization for Object3D
« on: May 31, 2011, 10:13:12 pm »
I seem to have a problem serializing Object3D... I am using a workaround which is not that nice (re-instancing with relevant data instead of serializing). I wonder why is that happening: trying to serialize generates errors because it can't serialize (unrelated) stuff like GLThread or other threads. In this trace, ThrowableObject3D line 32 is for writeObject(object3D):
I/RunActivity(19405): Unable to save game state java.io.NotSerializableException: android.opengl.GLSurfaceView$GLThread
W/System.err(19405): java.io.NotSerializableException: android.opengl.GLSurfaceView$GLThread
W/System.err(19405):    at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1547)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1859)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1701)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1665)
W/System.err(19405):    at java.util.HashMap.writeObject(HashMap.java:1025)
W/System.err(19405):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(19405):    at java.lang.reflect.Method.invoke(Method.java:521)
W/System.err(19405):    at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1229)
W/System.err(19405):    at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1587)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1859)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1701)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1665)
W/System.err(19405):    at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1153)
W/System.err(19405):    at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:420)
W/System.err(19405):    at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1251)
W/System.err(19405):    at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1587)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1859)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1701)
W/System.err(19405):    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1665)
W/System.err(19405):    at com.loxai.run.ThrowableObject3D.writeObject(ThrowableObject3D.java:32)

20
that should be happening only on low/med detail settings... I thought it would be less CPU/GPU intensive, meant for low end devices. wouldn't that be so?

21
Support / Re: transparency problem
« on: May 30, 2011, 09:17:23 pm »
Ok, fiddling with setSortOffset() seems to do the trick (not completely sure because the issue wouldn't always show up, but the tests look alright). thanks!

22
I have done some modifications and improvements, including some things suggested by Egon. I would like to get feedback from tests on as many Android devices as possible to ensure it's working fine on all implementations, so please give it a shot and report back :)

Cheers!

23
Support / transparency problem
« on: May 30, 2011, 02:18:46 pm »
Hi,

I'm getting a transparency issue where objects calling setTransparency() have a strange see-through effect (see current beta of Run! on the Android Market) against each other. This effect can be seen when a road path is under a tree top (both objects using transparency).
Am I using it wrong?

cheers

24
Support / Re: framebuffer getPixels()
« on: May 27, 2011, 11:19:27 pm »
the alpha was in the right place, but not so the red and blue. Switching those generated the desired result:

                            int[] tmpPixels = fb.getPixels();
                            for (int i = 0; i < tmpPixels.length; i++){
                                int tmpInt = tmpPixels + 0xff000000;
                                int red = (tmpInt & 0x00ff0000)>>16;
                                int blue = (tmpInt & 0x000000ff)<<16;
                                tmpInt &= 0xff00ff00;
                                tmpInt += red + blue;
                                tmpPixels = tmpInt;
                            }
                            lastImage = Bitmap.createBitmap(tmpPixels, fb.getWidth(), fb.getHeight(), Config.ARGB_8888);

25
Support / framebuffer getPixels()
« on: May 27, 2011, 09:38:36 pm »
Hi,

I am having trouble getting the right colors to generate a bitmap from the framebuffer.getPixels() method. My thought was that fb would return ints with 24bits, 1 byte per color and that, depending on the Config when creating bitmap and some previos manipulation I would get the right result. I've tried different options but none has been succesful so, I thought I better ask instead of banging my head on this...
first I tried for Config.RGB_565, doing the following conversion (and other bitwise operations combos):

                            int[] tmpPixels = fb.getPixels();
                            for (int i = 0; i < tmpPixels.length; i++){
                                int tmpInt = ((tmpPixels & 0xf8) >> 3);
                                tmpInt += ((tmpPixels & 0xfc00) >> 5);
                                tmpInt += ((tmpPixels & 0xf80000) >> 11);
                                tmpPixels = tmpInt;
                            }
                            lastImage = Bitmap.createBitmap(tmpPixels, fb.getWidth(), fb.getHeight(), Config.RGB_565);

got nice unintended predator style views, playing with that :)
also tried with a more comfortable format, Config.ARGB_8888, only adding opaque alpha:

                            int[] tmpPixels = fb.getPixels();
                            for (int i = 0; i < tmpPixels.length; i++)
                                tmpPixels = tmpPixels + 0xff000000;
                            lastImage = Bitmap.createBitmap(tmpPixels, fb.getWidth(), fb.getHeight(), Config.ARGB_8888);

and this got me a blueish tint (closer but not quite)... which actually I have also seen in some screenshot taking software... which requires to tick an option to invert red and blue... so I also tried inverting R and B (resulting in a  predator/hello kitty effect):

                            int[] tmpPixels = fb.getPixels();
                            for (int i = 0; i < tmpPixels.length; i++){
                                int tmpInt = tmpPixels + 0xff000000;
                                tmpInt &= 0xff00ff00;//remove r and b
                                int inv = ~(tmpPixels & 0x00ff00ff);//invert r and b
                                tmpInt += inv;//add r and b
                                tmpPixels = tmpInt;
                            }
                            lastImage = Bitmap.createBitmap(tmpPixels, fb.getWidth(), fb.getHeight(), Config.ARGB_8888);

any suggestions/ideas/piece of code with the solution?

cheers!

26
thanks for the feedback, I'll work on all those...
regarding the animation, I agree it looks strange (long stretching legs)... scavenging for models/artwork can be difficult (that's actually from planetquake, a model representing John McClane ;) but I'll try the speed change.
and then there is this 'feature' (which I realized by accident but then kept through the development) with which you get a zoomed view when you change orientation... that's nice but a bit too close so, yes, I'll try to add different camera distances.

I'll be glad to have it included in the projects page

27
weird, the link worked for me... I've just published the beta on the market, available here: https://market.android.com/details?id=com.loxai.run

28
Projects / Run... RUUUUUUUN! (final version released)
« on: May 25, 2011, 01:27:12 pm »
Hi there!   :D

I thought it was about time to show what has kept me entertained for the last month... it's still incomplete and not fully tested, but works pretty nicely on my Galaxy S (and crawls 'glitchily' on a Pulse Mini). I hope to have a polished beta version for the Android Market soon... I wonder on what devices will it work!
See attached screenshots, and here's the test apk, the link probably won't last long as it is on megaupload:
http://www.megaupload.com/?d=K2WLC6NR

[attachment deleted by admin]

29
Support / Re: null pointer at world 1021
« on: May 23, 2011, 12:56:23 pm »
found it! again, a silly piece of code that had been there for a long time without causing trouble. I was disposing of the fb at the onDraw if the ticker wasn't ready to start processing, I guess it was some sort of racing condition and/or maybe having an early automatic onDraw call on surface creation...
thanks for the replies, which led to finding the issue, and sorry for wasting your time  :-\
in any case, maybe isInitialized should return a false after the fb has been disposed.

30
Support / Re: null pointer at world 1021
« on: May 23, 2011, 12:36:44 pm »
that was one of my first checks, but I checked again, now adding fb.isInitialized():
Utils.log(fb.toString()+" "+fb.isInitialized());
E/AndroidRuntime(18548): java.lang.NullPointerException
E/AndroidRuntime(18548):        at com.threed.jpct.FrameBuffer.isInitialized(FrameBuffer.java:109)

I am wondering now. I create the renderer onCreate, but I don't start drawing on it until much later (on user selection). In the mean time, the GLView is beneath a regular View (containing the main menu)... could it be something like framebuffer being disposed as part of a MemoryHelper.compact or other gc stuff?

Pages: 1 [2] 3