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

Pages: [1]
1
Thank you so much!

Bones works very well. There is no Quaternion object in runtime! :o
This Bone's version  has many different thing against the old version (ver 2), so can you tell me what features are added or upgraded?

2
Hi raft,

In my android game, i create multi AnimatedGroup from the same model and let all of them  animate continuously  at the same time. The problem is your slerp() function create so many Quaternion object in runtime, thus my game is slow down. Can you tell me how to reduce the number of Quaternion object or whatever to speed up my game?

I create AnimatedGroups at the same way with your bones example.

thank you so much.

3
News / Re: Version 1.22 has been released!
« on: June 01, 2011, 04:56:28 am »
it's a great news!

Can you explain for me What are following component's purpose?

 +/the GL20 class and GL20Handler class.
 +/defaultFragmentShader.src, defaultVertexShader.src

How can i use them?

4
Support / Re: OutOfMemory error occurs when restart game
« on: May 27, 2011, 07:12:18 am »
At the game starting process, i already excuted TextureManager.flush() and when activity is destroyed, i set glSurfaceView = null.

But it's not work. How can i flush GPU memory?

5
uhm, I think this is an unknown error when put a surfaceView on the top of a GLSurfaceView. I used a View instead of SurfaceView and eveything is ok with the same code!  ???  :-\

6
Support / Re: OutOfMemory error occurs when restart game
« on: May 24, 2011, 04:21:37 am »

Firstly, thanks for your answer!!!

Yes, I want to delete all of resources when game was exited and reload them at the next start time. I can use System.exit(). But i don't understand why data wasn't deleted when game was exited even though i closed the main activity! Where are resources stored? Does jpct manage this storing? How can i do the completly erasing without using System.exit()?


7
Support / OutOfMemory error occurs when restart game
« on: May 23, 2011, 06:02:29 am »
Hi all,

When i start my game after the first time ( when it was installed), all the previously loaded graphic data(ex. texture, object3D, ....) is not erased and it  is loaded again and again  till the buffer OutOfMemory error occurs. After the error occurs, all data is erased. How to erased that data when exiting the game?

I am sorry if this is a very simple mistake!

8
Hi EgonOlsen

i checked my project again. Now, i will descript more detail:
 - I used FrameLayout to display a SurfaceView and a GLSurfaceView with SurfaceView is on the top.
 - On my test project, everything was fine.
 - On my main project, everything works, except SurfaceView cannot display on the top. The differrent thing bettwen the test project and the main project is in the main project , glSufaceView must take a long time to load resources. When i try to set transparenct background for glSurfaceView, i can see a part of SurfaceView at black color areas on glSurfaceView.
 - The main project is fine on emulator but on IS03, Nexus I

 
Code: [Select]
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        SCREEN_WIDTH=getWindowManager().getDefaultDisplay().getWidth();
        SCREEN_HEIGHT=getWindowManager().getDefaultDisplay().getHeight();
       
       requestWindowFeature(Window.FEATURE_NO_TITLE);
       this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
       
       fLayout= new FrameLayout(getApplicationContext());
       
       glSurfaceView =  new GLSurfaceView(getApplication());
       glSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
       glSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
   

       renderer= new RendererImplement();
       renderer.loadTextures(getResources());
       glSurfaceView.setRenderer(renderer); 
       
       
       screenSurface= new mySurfaceView(getApplicationContext());
       screenSurface.getHolder().setFormat(PixelFormat.RGBA_8888);
       


       fLayout.addView(screenSurface);
       fLayout.addView(glSurfaceView);
       

       setContentView(fLayout);
       
    }

9
In my project, i display some 3D models with GLSurfaceView and i use a transparent background SurfaceView on the top to display a small 2D picture on the screen. The problem is the 2D picture cannot display when all 3D models were displayed. If i set invisible for some 3D models, the 2D picture is showned. Is it a memory or framebuffer problem?

10
Hi everyone.

This example use FrameLayout to display 2 layout, but they are still in the same activity. How can we make the same thing with 2 activity (the top one has transparent background)?

 ???  ???  ???

11
Support / Re: How to do 2D click to 3D object picking?
« on: May 16, 2011, 09:21:59 am »
Thank you very much, EgonOlsen.

You are right. it worked. :D

12
Support / Re: How to do 2D click to 3D object picking?
« on: May 13, 2011, 06:04:02 am »
Hi EgonOlsen,

Based on http://www.jpct.net/wiki/index.php/Picking, it didn't work when i touch on object but if i touch on another area that is beside object --> it work.

Code: [Select]
SimpleVector p = Interact2D.reproject2D3D(camera, frameBuffer, (int)touchPos.x,(int)touchPos.y).normalize();
  Object[] objs= world.calcMinDistanceAndObject3D(camera.getPosition(), p, 1000);

how can i fix it?

i am using  the jpct-ae version that was posted at http://www.jpct.net/forum2/index.php/topic,1561.225.html.




13
Support / Re: Out of memory when load 3ds file.
« on: March 17, 2011, 06:09:42 am »
this is my mistake!

I didn't use fb.display() in onDrawFrame function


14
Support / Out of memory when load 3ds file.
« on: March 17, 2011, 03:03:05 am »
Hi guys,

I created a teaport with 3ds Max, then export it to .3ds file.
On Android, i load that 3ds file to display. The teaport was displayed, but after a while, the error happened.

on LogCat, i saw this message appeared about 2116 times:

03-17 08:44:52.635: INFO/jPCT-AE(xxx): Additional visibility list (xxxx) created with size: 512

Here is my code:

Code: [Select]
package com.dlh.Second_jPCT;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.opengles.GL10;

import com.threed.jpct.Camera;
import com.threed.jpct.Config;
import com.threed.jpct.FrameBuffer;
import com.threed.jpct.Light;
import com.threed.jpct.Loader;
import com.threed.jpct.Matrix;
import com.threed.jpct.Object3D;
import com.threed.jpct.OcTree;
import com.threed.jpct.RGBColor;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.Texture;
import com.threed.jpct.TextureManager;
import com.threed.jpct.World;
import com.threed.jpct.util.BitmapHelper;

import android.app.Activity;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.opengl.GLSurfaceView;
import android.opengl.GLSurfaceView.EGLConfigChooser;
import android.opengl.GLSurfaceView.Renderer;
import android.os.Bundle;
import android.util.Log;

public class Second_jPCT extends Activity {
   
GLSurfaceView glSurface;

World world;
FrameBuffer fb;
TextureManager ttman;
Camera cam;
Object3D terrain, teaport;
Light sun;

boolean first=true;
/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        glSurface= new GLSurfaceView(getApplication());
        glSurface.setRenderer(new MyRenderer());
       
        setContentView(glSurface);   
    }
    @Override
    protected void onPause() {
    // TODO Auto-generated method stub
        glSurface.onPause();
    super.onPause();
    }
    @Override
    protected void onResume() {
    // TODO Auto-generated method stub
        glSurface.onResume();
    super.onResume();
    }
    class MyRenderer implements Renderer{

@Override
public void onDrawFrame(GL10 arg0) {
// TODO Auto-generated method stub
fb.clear(new RGBColor(20,20,20));
world.renderScene(fb);
world.draw(fb);
}

@Override
public void onSurfaceChanged(GL10 arg0, int arg1, int arg2) {
// TODO Auto-generated method stub
if(fb!=null){
fb.dispose();
}
fb= new FrameBuffer(arg0, arg1, arg2);
}

@Override
public void onSurfaceCreated(GL10 arg0, EGLConfig arg1) {
// TODO Auto-generated method stub

world= new World();
        world.setAmbientLight(30, 30, 30);
               
        Drawable image= getResources().getDrawable(R.drawable.rocks);
        Texture rock= new Texture(BitmapHelper.rescale(BitmapHelper.convert(image), 64, 64) );
        TextureManager.getInstance().addTexture("ground",rock);

AssetManager assMan = getResources().getAssets();
InputStream is= new InputStream() {

@Override
public int read() throws IOException {
// TODO Auto-generated method stub
return 0;
}
};
try {
is =  assMan.open("teaport.3ds", AssetManager.ACCESS_UNKNOWN);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Object3D[] objs= Loader.load3DS(is, 1);

if(objs.length>0){
teaport= objs[0];
teaport.setTexture("ground");
}
teaport.enableLazyTransformations();
world.addObject(teaport);
teaport.build();
teaport.strip();

         cam= world.getCamera();
         cam.setPosition(new SimpleVector(0,-5,0));
         cam.lookAt(teaport.getTransformedCenter());
         
         sun = new Light(world);
         sun.setIntensity(250, 250, 250);
         sun.setPosition(new SimpleVector(0,-20,0));
}
   
    }
   
}

how can resolve this?

Pages: [1]