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 - gamerfan

Pages: 1 2 3 [4] 5 6 7
46
Support / Re: java.lang.OutOfMemoryError while Loading .md2 model
« on: October 31, 2011, 05:48:53 am »
Code: [Select]
10-31 10:11:38.490: INFO/System.out(285): Start loading crab md2 model
10-31 10:11:38.490: INFO/jPCT-AE(285): Loading file from InputStream
10-31 10:11:38.512: INFO/jPCT-AE(285): Expanding buffers...16384 bytes
10-31 10:11:38.512: INFO/jPCT-AE(285): Expanding buffers...24576 bytes
10-31 10:11:38.512: INFO/jPCT-AE(285): Expanding buffers...32768 bytes
10-31 10:11:38.512: INFO/jPCT-AE(285): Expanding buffers...40960 bytes
10-31 10:11:38.522: INFO/jPCT-AE(285): Expanding buffers...49152 bytes
10-31 10:11:38.522: INFO/jPCT-AE(285): Expanding buffers...57344 bytes
10-31 10:11:38.522: INFO/jPCT-AE(285): Expanding buffers...65536 bytes
10-31 10:11:38.721: INFO/jPCT-AE(285): Expanding buffers...73728 bytes
10-31 10:11:38.721: INFO/jPCT-AE(285): Expanding buffers...81920 bytes
10-31 10:11:38.781: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 1124 objects / 406824 bytes in 56ms
10-31 10:11:38.791: INFO/jPCT-AE(285): Expanding buffers...163840 bytes
10-31 10:11:38.852: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 138 objects / 86400 bytes in 61ms
10-31 10:11:38.852: INFO/jPCT-AE(285): Expanding buffers...245760 bytes
10-31 10:11:38.901: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 70 objects / 166128 bytes in 48ms
10-31 10:11:38.910: INFO/dalvikvm-heap(285): Grow heap (frag case) to 3.948MB for 327696-byte allocation
10-31 10:11:38.991: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 1 objects / 245784 bytes in 83ms
10-31 10:11:38.991: INFO/jPCT-AE(285): Expanding buffers...327680 bytes
10-31 10:11:38.991: INFO/jPCT-AE(285): Expanding buffers...409600 bytes
10-31 10:11:39.001: INFO/jPCT-AE(285): File from InputStream loaded...378156 bytes
10-31 10:11:39.062: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 18 objects / 328488 bytes in 59ms
10-31 10:11:39.062: INFO/jPCT-AE(285): Magic number: 844121161
10-31 10:11:39.062: INFO/jPCT-AE(285): Version: 8
10-31 10:11:39.062: INFO/jPCT-AE(285): Skin width: 256
10-31 10:11:39.062: INFO/jPCT-AE(285): Skin height: 256
10-31 10:11:39.062: INFO/jPCT-AE(285): Frame size: 1720
10-31 10:11:39.062: INFO/jPCT-AE(285): Number of skins: 1
10-31 10:11:39.062: INFO/jPCT-AE(285): Number of Vertices: 420
10-31 10:11:39.062: INFO/jPCT-AE(285): Number of Texture coordinates: 420
10-31 10:11:39.062: INFO/jPCT-AE(285): Number of triangles: 715
10-31 10:11:39.062: INFO/jPCT-AE(285): Number of GL-commands: 6801
10-31 10:11:39.062: INFO/jPCT-AE(285): Number of Frames: 198
10-31 10:11:39.071: INFO/jPCT-AE(285): Reading Texture coordinates...
10-31 10:11:39.071: INFO/jPCT-AE(285): Done!
10-31 10:11:39.071: INFO/jPCT-AE(285): Reading polygonal data...
10-31 10:11:39.081: INFO/jPCT-AE(285): Done!
10-31 10:11:39.152: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 67 objects / 412672 bytes in 56ms
10-31 10:11:39.302: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 2 objects / 48 bytes in 58ms
10-31 10:11:39.540: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 2 objects / 48 bytes in 83ms
10-31 10:11:39.812: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 2 objects / 48 bytes in 97ms
10-31 10:11:40.040: INFO/jPCT-AE(285): Reading keyframes...
10-31 10:11:40.540: INFO/jPCT-AE(285): Done!
10-31 10:11:40.540: INFO/jPCT-AE(285): Coverting MD2-format into jPCT-format...
10-31 10:11:42.092: INFO/jPCT-AE(285): Processing: stand...
10-31 10:11:42.221: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 2229 objects / 512512 bytes in 107ms
10-31 10:11:43.101: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 9185 objects / 1014944 bytes in 200ms
10-31 10:11:43.871: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 8805 objects / 1092064 bytes in 107ms
10-31 10:11:44.821: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 10257 objects / 1161600 bytes in 124ms
10-31 10:11:44.921: INFO/jPCT-AE(285): Processing: run...
10-31 10:11:45.271: INFO/jPCT-AE(285): Processing: attack...
10-31 10:11:45.712: INFO/ActivityManager(60): Process com.android.settings (pid 120) has died.
10-31 10:11:45.771: INFO/jPCT-AE(285): Processing: pain...
10-31 10:11:45.901: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11736 objects / 1387208 bytes in 116ms
10-31 10:11:46.222: WARN/ActivityManager(60): Launch timeout has expired, giving up wake lock!
10-31 10:11:46.541: INFO/jPCT-AE(285): Processing: jump...
10-31 10:11:46.641: WARN/ActivityManager(60): Activity idle timeout for HistoryRecord{4401ab98 org.me.home/.GameActivity}
10-31 10:11:46.891: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11728 objects / 1386968 bytes in 120ms
10-31 10:11:47.012: INFO/jPCT-AE(285): Processing: flip...
10-31 10:11:47.780: INFO/jPCT-AE(285): Processing: salute...
10-31 10:11:48.030: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11732 objects / 1386968 bytes in 134ms
10-31 10:11:48.511: INFO/jPCT-AE(285): Processing: taunt...
10-31 10:11:49.051: INFO/ActivityManager(60): Process android.process.media (pid 208) has died.
10-31 10:11:49.160: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11731 objects / 1386936 bytes in 257ms
10-31 10:11:49.691: INFO/jPCT-AE(285): Processing: wave...
10-31 10:11:50.172: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11731 objects / 1386968 bytes in 135ms
10-31 10:11:50.442: INFO/jPCT-AE(285): Processing: point...
10-31 10:11:51.221: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11731 objects / 1386912 bytes in 150ms
10-31 10:11:51.281: INFO/jPCT-AE(285): Processing: crstnd...
10-31 10:11:52.262: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11731 objects / 1386952 bytes in 148ms
10-31 10:11:52.471: INFO/jPCT-AE(285): Processing: crwalk...
10-31 10:11:52.811: INFO/jPCT-AE(285): Processing: crattack...
10-31 10:11:53.451: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11732 objects / 1387008 bytes in 169ms
10-31 10:11:53.611: INFO/jPCT-AE(285): Processing: crpain...
10-31 10:11:53.801: DEBUG/dalvikvm(117): GC_EXPLICIT freed 209 objects / 9944 bytes in 1196ms
10-31 10:11:53.832: INFO/jPCT-AE(285): Processing: crdeath...
10-31 10:11:54.102: INFO/jPCT-AE(285): Processing: death...
10-31 10:11:54.282: INFO/ActivityManager(60): Process com.android.alarmclock (pid 167) has died.
10-31 10:11:54.511: INFO/dalvikvm-heap(285): Clamp target GC heap from 16.486MB to 16.000MB
10-31 10:11:54.511: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 11733 objects / 1387056 bytes in 163ms
10-31 10:11:55.421: INFO/dalvikvm-heap(285): Clamp target GC heap from 16.975MB to 16.000MB
10-31 10:11:55.421: DEBUG/dalvikvm(285): GC_FOR_MALLOC freed 8072 objects / 1005472 bytes in 240ms
10-31 10:11:55.661: INFO/jPCT-AE(285): Done!
10-31 10:11:55.661: INFO/System.out(285): End loading crab md2 model
10-31 10:11:55.792: INFO/jPCT-AE(285): Normal vectors calculated in 126ms!
10-31 10:11:55.792: INFO/System.out(285): ....Returning from draw method...
10-31 10:11:55.851: INFO/jPCT-AE(285): [ 1320036115857 ] - WARNING: Object object3 hasn't been build yet. Forcing build()!
10-31 10:11:55.851: INFO/jPCT-AE(285): Normal vectors calculated in 2ms!
10-31 10:11:55.861: ERROR/dalvikvm-heap(285): 288-byte external allocation too large for this process.
10-31 10:11:55.861: WARN/OSMemory(285): External allocation of 288 bytes was rejected
10-31 10:11:55.901: WARN/dalvikvm(285): threadid=7: thread exiting with uncaught exception (group=0x4001d800)
10-31 10:11:55.931: INFO/ActivityManager(60): Displayed activity org.me.home/.GameActivity: 19632 ms (total 19632 ms)
10-31 10:11:56.041: ERROR/AndroidRuntime(285): FATAL EXCEPTION: GLThread 8
10-31 10:11:56.041: ERROR/AndroidRuntime(285): java.lang.OutOfMemoryError
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at org.apache.harmony.luni.platform.OSMemory.malloc(Native Method)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at org.apache.harmony.luni.platform.PlatformAddressFactory.alloc(PlatformAddressFactory.java:150)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:66)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at java.nio.ReadWriteDirectByteBuffer.<init>(ReadWriteDirectByteBuffer.java:51)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at java.nio.BufferFactory.newDirectByteBuffer(BufferFactory.java:93)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:68)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at com.threed.jpct.CompiledInstance.fill(CompiledInstance.java:740)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at com.threed.jpct.Object3DCompiler.compile(Object3DCompiler.java:151)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at com.threed.jpct.World.compile(World.java:2055)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at com.threed.jpct.World.compileAllObjects(World.java:1000)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at org.me.home.GameActivity$MyRenderer.onSurfaceChanged(GameActivity.java:295)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1325)
10-31 10:11:56.041: ERROR/AndroidRuntime(285):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
10-31 10:11:56.231: WARN/ActivityManager(60):   Force finishing activity org.me.home/.GameActivity

47
Support / java.lang.OutOfMemoryError while Loading .md2 model
« on: October 28, 2011, 03:00:20 pm »
I have a problem here.I am trying to load a.md2 model first by using Loader.loadSerialize....() method.The size of .ser file is 363 kb.The original size of the .md2 file is 370kb.But at this time there is no error reported in the console and the model does not load or display in the screen or not getting any error on the console. So I decided to load the model using Loader.loadMd2() method. It loads all the animations and finally it says model loaded and followed by it throws this error.This error happens exactly at this line.

Code: [Select]
world.compileAllObjects(fb);
=========The method that loads the md2 model
So I removed all of the animations except one from it.But still I am getting the same error.
Code: [Select]
private Object3D drawCrabs(){
       Object3D crab = null;
                Resources res = getResources();
         //       try {
                    System.out.println("Start loading crab md2 model");
                    crab = Loader.loadMD2(res.openRawResource(R.raw.crab), 0.1f);
                    //crab = Loader.loadSerializedObject(new GZIPInputStream(res.openRawResource(R.raw.crabser)));
                    System.out.println("End loading crab md2 model");
         //       }
         //    catch (IOException ex) {
           //     java.util.logging.Logger.getLogger(GameActivity.class.getName()).log(Level.SEVERE, null, ex);
         //   }
                //crab = Loader.loadSerializedObject(res.openRawResource(R.drawable.crabser));
               // crab = Loader.loadMD2(getAssets().open("model/crabser.ser"), 1.0f);
              //  Bitmap image = BitmapFactory.decodeResource(res, R.drawable.crab1);
              //  Texture texture = new Texture(image);
             //   TextureManager.getInstance().addTexture("crabone", texture);
             //   crab.setTexture("crabone");
               // removing some of the animation sequences from the model
                    int flip   = crab.getAnimationSequence().getSequence("flip");
                    int salute = crab.getAnimationSequence().getSequence("salute");
                    int point  = crab.getAnimationSequence().getSequence("point");
                    int attack = crab.getAnimationSequence().getSequence("attack");
                    int pain   = crab.getAnimationSequence().getSequence("pain");
                    int jump   = crab.getAnimationSequence().getSequence("jump");
                    int taunt  = crab.getAnimationSequence().getSequence("taunt");
                    int wave   = crab.getAnimationSequence().getSequence("wave");   
                    int crstnd   = crab.getAnimationSequence().getSequence("crstnd");
                    int crwalk   = crab.getAnimationSequence().getSequence("crwalk");
                    int crattack   = crab.getAnimationSequence().getSequence("crattack");
                    int crpain  = crab.getAnimationSequence().getSequence("crpain");
                    int crdeath  = crab.getAnimationSequence().getSequence("crdeath");
                    int death  = crab.getAnimationSequence().getSequence("death");


                    crab.getAnimationSequence().remove(flip);
                    crab.getAnimationSequence().remove(salute);
                    crab.getAnimationSequence().remove(point);
                    crab.getAnimationSequence().remove(attack);
                    crab.getAnimationSequence().remove(pain);
                    crab.getAnimationSequence().remove(jump);
                    crab.getAnimationSequence().remove(taunt);
                    crab.getAnimationSequence().remove(wave);
                    crab.getAnimationSequence().remove(crstnd);
                    crab.getAnimationSequence().remove(crwalk);
                    crab.getAnimationSequence().remove(crattack);
                    crab.getAnimationSequence().remove(crpain);
                    crab.getAnimationSequence().remove(crdeath);
                    crab.getAnimationSequence().remove(death);
                   
                crab.compile();
             //   crab.strip();
                crab.build();
                System.out.println("....Returning from draw method...");
            return crab;
   }
I am using netbeans android emulator for development.

48
Support / Re: Runtime exception when changed to Opengl ES 2.0
« on: October 26, 2011, 08:55:05 am »
@EgonOlsen.Please hold on.I want some other clarifications as well.Using OpenGL ES earlier version, I know that I cannot use shader in android emulator. But when I googled around , I came to know that shading mechanism can implemented using pixel shader as well .So can I use pixel shader implementation with OpenGL ES version 1.0 in the framework?

Secondly, I am not using OpenGL ES version 2.0 immdiately as I do not have any device.So you do not have to upload it now.

Third thing, can we have a mechanism using JNI so that it will work on Android emulator as well?

49
Support / Re: Runtime exception when changed to Opengl ES 2.0
« on: October 25, 2011, 02:17:38 pm »
No I have not extracted any classes from jar file. 
Quote
Apart from that, keep in mind that the emulator doesn't support OpenGL ES 2.0 anyway
:'(

50
Support / Runtime exception when changed to Opengl ES 2.0
« on: October 25, 2011, 10:28:39 am »
I am getting the following Runtime Exception when I change to OpenGL ES 2.0.I have updated with the latest japct-ae.jar.

Code: [Select]
10-25 13:50:59.462: ERROR/AndroidRuntime(592): java.lang.RuntimeException: [ 1319530859409 ] - ERROR: java.lang.RuntimeException: [ 1319530859350 ] - ERROR: java.lang.RuntimeException: [ 1319530859305 ] - ERROR: java.lang.RuntimeException: [ 1319530859286 ] - ERROR: Couldn't read file from InputStream
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.Logger.log(Logger.java:189)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.Loader.loadBinaryFile(Loader.java:1111)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.Loader.loadTextFile(Loader.java:71)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.Loader.loadTextFile(Loader.java:61)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:210)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.GL20.<init>(GL20.java:118)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at java.lang.Class.newInstanceImpl(Native Method)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at java.lang.Class.newInstance(Class.java:1429)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.GLRenderer.init(GLRenderer.java:469)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
10-25 13:50:59.462: ERROR/AndroidRuntime(592):     at org.me.home.GameActivity$MyRenderer.onSurfaceChanged(GameActivity.java:207)
I have done the modifications the way it were specified in wiki.Am I missing anything?

51
Support / Re: Changing u/v coordinates on the fly
« on: October 24, 2011, 09:47:47 am »
Sorry @EgonOlsen, I do not have any device that supports android at the moment. :'( . But if this implementation will work in android devices in real time, then no problem for me. I can experience this feature later on the real device. At least in the development face, I can just ignore this.Not a problem.I am just going through its features.However, I do not have much idea about this whether this feature will support in android emulator as emulator is purely unknown from the framework related features.

Btw, I am attaching an image to this thread as it would be more clear to you what I am doing.The blue back ground is the water texture and that is the one supposed to be animated.


[attachment deleted by admin]

52
Support / Re: Changing u/v coordinates on the fly
« on: October 24, 2011, 06:42:53 am »
Currently, I am using NetBeans emulator only for development.

53
Support / Re: Changing u/v coordinates on the fly
« on: October 21, 2011, 08:28:05 am »
I  tried using the latest version of the jar.But still it is not working.Also, I am not using OpenGL ES 2.0. I think  I am using old version only.

54
Support / Re: Changing u/v coordinates on the fly
« on: October 21, 2011, 07:18:15 am »
No I am not using OpenGL ES 2.0 renderer.

55
Support / Re: Changing u/v coordinates on the fly
« on: October 20, 2011, 01:43:56 pm »
when I use like this below,
Code: [Select]
water.setTextureMatrix(matrix);
nothing happens,the back ground texture is not moving.

56
Support / Re: Changing u/v coordinates on the fly
« on: October 20, 2011, 12:00:45 pm »
It seems to be working. :). This is the code that does the thing:
Code: [Select]
private void createWaterMoveEffect1() {
       System.out.println(" texture x: " + matrix.getTranslation().x);
       if(matrix.getTranslation().x > 15) {
           //SimpleVector sv = matrix.getTranslation();
           //sv.set(1.0f, 0.0f, 0.0f);
           //matrix.getTranslation().x = 1.0f;
           //matrix.translate(1.0f, 0.0f, 0.0f);
           matrix = new Matrix();
       }
       matrix.translate(1.0f, 0.0f, 0.0f);
       water.setTranslationMatrix(matrix);
   }
I am calling this method from the onDrawFrame() method.There are something here.

1.The water seems to be moving which means that entire plane object  itself is moving in the back ground.

2. At some point, this plane moves away from the screen.So I re-initialized the matrix after some units on x-axis.So it starts all over again.That is what has been done in if block of the code.Is there any better way to do this? I had tried something in the code related to this but that  is not working.The commented block.

3.When the water layer animates on the background, it cuts away some of the 3d model and it becomes deformed.Basically the object is a cylinder.The upper portion of the cylinder is getting chopped off when the water starts animating.Why this is happening like this?


57
Support / Re: Changing u/v coordinates on the fly
« on: October 20, 2011, 07:32:49 am »
I was working out logic this way. Please correct me if I am wrong.
1. I am creating a translation matrix with the texture co-ordinates( ?)
2. In a timer task I will call a method that will change the co-ordinates of a translation matrix.
3. And will call Object3D.setTextureMatrix( with this matrix)
4. call touch() method on Object3D.

Also, how can I get the texture co-ordonates?

58
Support / Re: Changing u/v coordinates on the fly
« on: October 19, 2011, 07:31:23 am »
But how to set it ? Is there any example related to this?

59
Support / Re: Changing u/v coordinates on the fly
« on: October 18, 2011, 02:36:56 pm »
I want to create a ripple effect in water.So in this case, do I need to change all the values of the texture cordinates from - to +? As paul suggested I have created a timer task in which I am periodically changing the texture co-ordinates.You can see the following code
Code: [Select]
private void createWaterMoveEffect() {
     System.out.println(" inside the createWaterMoveEffect()....")   ;
     for(int i = 0; i<10; i++) {
       quaduv.setU1(i);
       quaduv.setV1(i + 2);
     }
     textureInfo1 = new TextureInfo(TextureManager.getInstance().getTextureID("water"), quaduv.getU1(), quaduv.getV1(),quaduv.getU2(),quaduv.getV2(), quaduv.getU3(), quaduv.getV3());
     textureInfo2 = new TextureInfo(TextureManager.getInstance().getTextureID("water"), quaduv.getU3(), quaduv.getV3(),quaduv.getU4(),quaduv.getV4(), quaduv.getU1(), quaduv.getV1());
     water.getPolygonManager().setPolygonTexture(0, textureInfo1);
     water.getPolygonManager().setPolygonTexture(1, textureInfo2);
   //  water.compile(true, true)
     water.touch();
   }
This method is getting called from a timer task.


60
Support / Re: Changing u/v coordinates on the fly
« on: October 18, 2011, 08:52:38 am »
I am also trying to understand it. When you talk about changing UV values periodically means , what are the possible values that a texture co-ordinates can accept ? can you please elaborate.Thanks

Pages: 1 2 3 [4] 5 6 7