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 ... 7
31
Support / Re: loading .bsp or quake level
« on: November 21, 2011, 10:37:12 am »
I have one more clarifcation.If I convert quake 3 map to .3ds format, do I have to remove lightmap every time so that it will be loaded  in Android ?

32
Support / Re: loading .bsp or quake level
« on: November 17, 2011, 01:01:27 pm »
is there any preferred standard for JPCT in this case?
Also, in JPCT SE version there is quake level converted to .3ds format with size around 340 kB.Can I load it in AE version? Or are there any changes I have to make on the model?

33
Support / Re: loading .bsp or quake level
« on: November 17, 2011, 11:34:17 am »
I have googled around  and came across some solution for this.There is a framework called quake2android(http://code.google.com/p/quake2android/). The implementation has been done using C and Java in OpenGL.
But my concern is here that if I used this to load (or somehow), can it be loaded in all mobile phones that is having support for Android OS? Are there any limitations ?

34
Support / loading .bsp or quake level
« on: November 17, 2011, 08:24:37 am »
How can I load a .bsp file or quake level? Is there any size restriction in android environment? Or can I load a .bsp file as it is in Android env?

35
Support / Re: Using native gl commands
« on: November 10, 2011, 09:15:20 am »
You are right,there is no gl command for that. It is to be rendered. I have a java file that does it.so my query is that if at all I was able to render it, can I display it along with other objects of jpctAE?

36
Support / Using native gl commands
« on: November 10, 2011, 05:31:12 am »
can I use native gl commands in side onDrawFrame(GL10 gl) method? Say for example, if I want to render some objects based on CSG(Constructive Solid Geometry), how can I do it in jpct-Ae?

37
Support / Re: .md2 model not animating
« on: November 08, 2011, 10:28:59 am »
I have taken this model from some other c++ game.Sorry,  I do not have much idea about it.

38
Support / .md2 model not animating
« on: November 07, 2011, 01:50:26 pm »
Hi This is question is inspite of doing all the required steps while loading and animate a .md2 model, it is just displaying it on the screen.But not animating.I have attached the code for loading the model and displaying it on the screen.

Code: [Select]
   private Object3D drawCrabs(){
       Object3D crab = null;
       Resources res = getResources();
       crab = Loader.loadSerializedObject(res.openRawResource(R.raw.crab));
       Bitmap image = BitmapFactory.decodeResource(res, R.drawable.crab1);
       Texture texture = new Texture(image);
       TextureManager.getInstance().addTexture("crabone", texture);
       crab.setTexture("crabone");
       crab.compile(true, false);
       crab.strip();
       crab.build();
       return crab;
   }
Render animation
Code: [Select]
public void onDrawFrame(GL10 gl) {
if (touchTurn != 0) {
touchTurn = 0;
yDelta += 0.02f;
}
if (touchTurnUp != 0) {
    touchTurnUp = 0;
}

                        // animating the model to attack
                        crab1.animate(anim, crab1.getAnimationSequence().getSequence("attack"));
                        anim += 0.1f;
                        if (anim >= 1)
                        anim = 0;
                        // end of animation

fb.clear(back);
world.renderScene(fb);
world.draw(fb);
fb.display();
if (System.currentTimeMillis() - time >= 1000) {
// Logger.log(fps + "fps");
fps = 0;
time = System.currentTimeMillis();
}
fps++;
}
What I am missing here.

39
Support / Re: java.lang.OutOfMemoryError while Loading .md2 model
« on: November 04, 2011, 09:25:52 am »
yes , it is working as expected.In the model, I have removed some animation sequences and  the size of the model got reduced and serializated.I loaded the same model in my emulator without any problem.

40
Support / Re: java.lang.OutOfMemoryError while Loading .md2 model
« on: November 03, 2011, 09:34:58 am »
I was able to resolve the issue here. I just serialized the model and loaded after stripping some of the animation sequences.The .md2 model loaded successfully.But when I told that it was not working means I have some other objects also in the screen.Along with those objects, this model is not displaying.I came to know this when I commented some part of the code where it is loading the other models. :).Thanks for your support.However,I was able to understand some more things!.I  just loaded the model by serialzing it.

41
Support / Re: java.lang.OutOfMemoryError while Loading .md2 model
« on: November 03, 2011, 07:23:19 am »
I was able to load the model that is available in the alien runner AE application.That is loading.This is the code that is used to load it.
Code: [Select]
private InputStream loadZip() {
    ZipInputStream is = null;
    Resources res = getResources();
    is = new ZipInputStream(res.openRawResource(R.raw.crab));
    try {
  is.getNextEntry();
} catch (IOException e) {
    throw new RuntimeException(e);
}
    System.out.println(" the value of is "+is);
    return is;
   }
I serialized my model and later zipped it manually as you suggested after removing  many of the unwanted animation sequences by just leaving one animation and called strip() method on it with the following code. At this time, the size of the model was reduced considerably less.But when I loaded the model with the above method,I am getting the following exception.
Code: [Select]
private void serializeTheModel(String modelName) {
        System.out.println("[inside serializeTheModel methiod]") ;
        Object3D model = Loader.loadMD2(modelName, 0.1f);
        Animation animation = model.getAnimationSequence();
        animation.remove(animation.getSequence("stand"));
        animation.remove(animation.getSequence("attack"));
        animation.remove(animation.getSequence("pain"));
        animation.remove(animation.getSequence("jump"));
        animation.remove(animation.getSequence("flip"));
        animation.remove(animation.getSequence("salute"));
        animation.remove(animation.getSequence("taunt"));
        animation.remove(animation.getSequence("wave"));
        animation.remove(animation.getSequence("point"));
        animation.remove(animation.getSequence("crstnd"));
        animation.remove(animation.getSequence("crwalk"));
        animation.remove(animation.getSequence("crattack"));
        animation.remove(animation.getSequence("crpain"));
        animation.remove(animation.getSequence("crdeath"));
        animation.remove(animation.getSequence("death"));
        model.getAnimationSequence().strip();
        model.build();
        DeSerializer serializer = new DeSerializer();
        try {
              FileOutputStream fos = new FileOutputStream("crab.ser");
              serializer.serialize(model, fos, true);
              fos.close();
        } catch (IOException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("[ serializing the model is over......]") ;
      }
Quote
     11-03 11:40:14.390: ERROR/AndroidRuntime(566): java.lang.RuntimeException: [ 1320300614202 ] - ERROR: Can't deserialize object: null
11-03 11:40:14.390: ERROR/AndroidRuntime(566):     at com.threed.jpct.Logger.log(Logger.java:189)
11-03 11:40:14.390: ERROR/AndroidRuntime(566):     at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:210)
11-03 11:40:14.390: ERROR/AndroidRuntime(566):     at com.threed.jpct.Loader.loadSerializedObject(Loader.java:97)
11-03 11:40:14.390: ERROR/AndroidRuntime(566):     at org.me.home.GameActivity$MyRenderer.drawCrabs(GameActivity.java:405)
11-03 11:40:14.390: ERROR/AndroidRuntime(566):     at org.me.home.GameActivity$MyRenderer.onSurfaceChanged(GameActivity.java:281)
11-03 11:40:14.390: ERROR/AndroidRuntime(566):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1325)
11-03 11:40:14.390: ERROR/AndroidRuntime(566):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
What I am missing ?

42
Support / Re: java.lang.OutOfMemoryError while Loading .md2 model
« on: November 02, 2011, 10:10:54 am »
the problem is that when I serialize it, I am not able to load the model in AE.Also,, I tried the way you had suggested in the earlier post.But that way it is not reducing the size of the model

43
Support / Re: java.lang.OutOfMemoryError while Loading .md2 model
« on: November 02, 2011, 06:20:12 am »
This is the current method I am using serializing the model.
Code: [Select]
      private void serializeTheModel(String modelName) {
        System.out.println("[inside serializeTheModel methiod]") ;
        Object3D model = Loader.loadMD2(modelName, 0.1f);
        model.getAnimationSequence().strip();
        model.compile();
        model.build();
        DeSerializer serializer = new DeSerializer();
        try {
              serializer.serialize(model, new FileOutputStream("crab.ser"), true);
        } catch (IOException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("[ serializing the model is over......]") ;
      }
After this method execution, the size of the model becomes extremely large.It comes around 2 MB!. I do not have any idea why this is happening.

44
Support / Re: java.lang.OutOfMemoryError while Loading .md2 model
« on: November 01, 2011, 12:35:08 pm »
I have one clarification here. Using jPCT for desktop, if I call the above method and serialize the model, will the actual size of the model will reduce so that I can use it in AE version?

45
Support / Re: java.lang.OutOfMemoryError while Loading .md2 model
« on: October 31, 2011, 08:36:19 am »
I actually the model that I am using not made my me.It is used for some C++ openGL game application.I am just re using the model here. However, I can upload the model here:
http://code.google.com/p/androiddemogame/downloads/list.
From there you can download the models.

Pages: 1 2 [3] 4 5 ... 7