Main Menu
Menu

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.

Show posts Menu

Messages - ggp

#16
is easy

-touch sphere   obj ID= 4
   show ramp
-touch sphere
   hide  ramp
-touch sphere 
   show ramp
...

no working!
why??


private int selectAnyObjectAt( int mouseX, int mouseY){
        //Camera cam = world.getCamera();
        SimpleVector ray=Interact2D.reproject2D3DWS(cam, fb, mouseX, mouseY).normalize();
        Object[] res = world.calcMinDistanceAndObject3D(cam.getPosition(), ray, 10000F);
        if (res==null || res[1] == null || res[0] == (Object)Object3D.RAY_MISSES_BOX) {
            //Log.d("SELECTION", "You missed! x="+mouseX+" y="+mouseY);   
            selectedObject = null;
            return -1;
        }
        Object3D obj = (Object3D)res[1];
        Log.d("SELECTION", "x="+mouseX+" y="+mouseY+" id2="+obj.getID()+" name="+obj.getName());
        selectedObject = obj;   
       
       
       
        if(obj.getID()==4){   
            if(ramp.getVisibility()==true){
                ramp.setVisibility(false);
               
               
            }else{
                //SoundManager.getInstance().play(SoundManager.COLLECTED);   
                 ramp.setVisibility(true);
                 
            }
         
        }
       
       
        return obj.getID();
    }


#17
show this error in jpct-ae last version


02-12 13:34:15.693: E/dalvikvm(370): No free temp registers
02-12 13:34:15.693: E/dalvikvm(370): Jit: aborting trace compilation, reverting to interpreter
02-12 13:34:15.703: E/dalvikvm(370): No free temp registers
02-12 13:34:15.703: E/dalvikvm(370): Jit: aborting trace compilation, reverting to interpreter


and no hide ramp with puss down sphere with function selectAnyObjectAt


here the full code

package com.threed.jpct.example;

import java.io.InputStream;
import java.lang.reflect.Field;

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 android.app.Activity;
import android.content.res.Resources;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;

import com.threed.jpct.Camera;
import com.threed.jpct.Config;
import com.threed.jpct.FrameBuffer;
import com.threed.jpct.Interact2D;
import com.threed.jpct.Light;
import com.threed.jpct.Loader;
import com.threed.jpct.Logger;
import com.threed.jpct.Matrix;
import com.threed.jpct.Object3D;
import com.threed.jpct.Primitives;
import com.threed.jpct.RGBColor;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.Texture;
import com.threed.jpct.World;
import com.threed.jpct.util.MemoryHelper;

/**
* A simple demo. This shows more how to use jPCT-AE than it shows how to write
* a proper application for Android. It includes basic activity management to
* handle pause and resume...
*
* @author EgonOlsen
*
*/
public class HelloWorld extends Activity {

    // Used to handle pause and resume...
    private static HelloWorld master = null;

    private GLSurfaceView mGLView;
    private MyRenderer renderer = null;
    private FrameBuffer fb = null;
    private World world = null;
    private RGBColor back = new RGBColor(255, 0, 0);

    private float touchTurn = 0;
    private float touchTurnUp = 0;

    private float xpos = -1;
    private float ypos = -1;


    //private int fps = 0;

    private Light sun = null;

    //------------------------
    private Texture font = null;
   
    private float move = 0;
   
    private static final long serialVersionUID = 1L;

    private static final float DAMPING = 0.1f;

    private static final float SPEED = 1f;

    private static final float MAXSPEED = 1f;
   
    private Object3D plane = null;

    private Object3D ramp = null;

    private Object3D cube = null;

    private Object3D cube2 = null;

    private Object3D sphere = null;

    private float dxx;

    private SimpleVector moveRes = new SimpleVector(0, 0, 0);

    private SimpleVector ellipsoid = new SimpleVector(2, 2, 2);
   
    private Camera cam = null;
   
    private Object3D selectedObject = null;
   
    protected void onCreate(Bundle savedInstanceState) {

        Logger.log("onCreate");

        if (master != null) {
            copy(master);
        }

        super.onCreate(savedInstanceState);
        mGLView = new GLSurfaceView(getApplication());

        mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
            public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
                // Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
                // back to Pixelflinger on some device (read: Samsung I7500)
                int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
                EGLConfig[] configs = new EGLConfig[1];
                int[] result = new int[1];
                egl.eglChooseConfig(display, attributes, configs, 1, result);
                return configs[0];
            }
        });

        renderer = new MyRenderer();
        mGLView.setRenderer(renderer);
        setContentView(mGLView);
    }

    @Override
    protected void onPause() {
        super.onPause();
        mGLView.onPause();
    }

    @Override
    protected void onResume() {
        super.onResume();
        mGLView.onResume();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    private void copy(Object src) {
        try {
            Logger.log("Copying data from master Activity!");
            Field[] fs = src.getClass().getDeclaredFields();
            for (Field f : fs) {
                f.setAccessible(true);
                f.set(this, f.get(src));
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public boolean onTouchEvent(MotionEvent me) {

        if (me.getAction() == MotionEvent.ACTION_DOWN) {
            xpos = me.getX();
            ypos = me.getY();
            return true;
        }

        if (me.getAction() == MotionEvent.ACTION_UP) {
            xpos = -1;
            ypos = -1;
            touchTurn = 0;
            touchTurnUp = 0;
            return true;
        }

        if (me.getAction() == MotionEvent.ACTION_MOVE) {
            float xd = me.getX() - xpos;
            float yd = me.getY() - ypos;

            xpos = me.getX();
            ypos = me.getY();

            touchTurn = xd / -100f;
            touchTurnUp = yd / -100f;
           
            dxx = -xd / -200f;
            cube.rotateY(-dxx);
            return true;
        }

        try {
            Thread.sleep(15);
        } catch (Exception e) {
            // No need for this...
        }

        return super.onTouchEvent(me);
    }
   
    private int selectAnyObjectAt( int mouseX, int mouseY){
        //Camera cam = world.getCamera();
        SimpleVector ray=Interact2D.reproject2D3DWS(cam, fb, mouseX, mouseY).normalize();
        Object[] res = world.calcMinDistanceAndObject3D(cam.getPosition(), ray, 10000F);
        if (res==null || res[1] == null || res[0] == (Object)Object3D.RAY_MISSES_BOX) {
            //Log.d("SELECTION", "You missed! x="+mouseX+" y="+mouseY);   
            selectedObject = null;
            return -1;
        }
        Object3D obj = (Object3D)res[1];
        Log.d("SELECTION", "x="+mouseX+" y="+mouseY+" id2="+obj.getID()+" name="+obj.getName());
        selectedObject = obj;   
       
       
       
        if(obj.getID()==4){   
            if(ramp.getVisibility()==true){
                ramp.setVisibility(false);
               
               
            }else{
                //SoundManager.getInstance().play(SoundManager.COLLECTED);   
                 ramp.setVisibility(true);
                 
            }
         
        }
       
       
        return obj.getID();
    }

    public boolean onKeyDown(int keyCode, KeyEvent msg) {
        if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
            move = 1f;
            return true;
        }

        if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
            move = -1f;
            return true;
        }

        if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {
            cube.rotateY((float) Math.toRadians(-1));
            return true;
        }

        if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
            cube.rotateY((float) Math.toRadians(1));
            return true;
        }

       

        return super.onKeyDown(keyCode, msg);
    }
   
    public boolean onKeyUp(int keyCode, KeyEvent msg) {
        if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
            move = 0;
            return true;
        }

        if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
            move = 0;
            return true;
        }

        if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {
           
            return true;
        }

        if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
           
            return true;
        }

       

        return super.onKeyUp(keyCode, msg);
    }

   
    protected boolean isFullscreenOpaque() {
        return true;
    }

    class MyRenderer implements GLSurfaceView.Renderer {
        private int fps = 0;
        private int lfps = 0;
       
        private long time = System.currentTimeMillis();
        private boolean stop = false;
        public MyRenderer() {
           
            Config.maxPolysVisible = 500;
             Config.farPlane = 1500;
             Config.glTransparencyMul = 0.1f;
             Config.glTransparencyOffset = 0.1f;
             Config.useVBO=true;
             
             Texture.defaultToMipmapping(false);
             Texture.defaultTo4bpp(true);
        }
        public void stop() {
            stop = true;
        }

        public void onSurfaceChanged(GL10 gl, int w, int h) {
            if (fb != null) {
                fb.dispose();
            }
            fb = new FrameBuffer(gl, w, h);

            if (master == null) {
                Resources res = getResources();
                world = new World();
                world.setAmbientLight(20, 20, 20);

                sun = new Light(world);
                sun.setIntensity(250, 250, 250);
               
                //keyMapper = new KeyMapper(this);
               
                plane = Primitives.getPlane(20, 10);
                plane.rotateX((float) Math.PI / 2f);

                ramp = Primitives.getCube(20);
                ramp.rotateX((float) Math.PI / 2f);

                sphere = Primitives.getSphere(30);
                sphere.translate(-50, 10, 50);

                cube2 = Primitives.getCube(20);
                cube2.translate(60, -20, 60);
               
                cube = loadModel(res.openRawResource(R.raw.flecha), 0.5f);
                //cube = Primitives.getCube(2);
                //cube.rotateY((float) Math.PI / 2f);
                cube.translate(-50, -10, -50);
                cube.setAdditionalColor(RGBColor.GREEN);
                cube.strip();
                cube.build();

                plane.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
                ramp.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
                sphere.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
                cube2.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
                cube.setCollisionMode(Object3D.COLLISION_CHECK_SELF);
                ramp.setVisibility(false);
               
                world.addObject(plane);
                world.addObject(ramp);
                world.addObject(cube);
                world.addObject(sphere);
                world.addObject(cube2);
               
                Light light = new Light(world);
                light.setPosition(new SimpleVector(0, -80, 0));
                light.setIntensity(140, 120, 120);
                light.setAttenuation(-1);

                world.setAmbientLight(20, 20, 20);
               
                cam = world.getCamera();
                cam.moveCamera(Camera.CAMERA_MOVEOUT, 100);
                cam.moveCamera(Camera.CAMERA_MOVEUP, 100);
                cam.lookAt(ramp.getTransformedCenter());
               
                //long start = System.currentTimeMillis();
                //long fps = 0;

                SimpleVector sv = new SimpleVector();
                sv.set(cube.getTransformedCenter());
                sv.y -= 50;
                sv.z -= 100;
                sun.setPosition(sv);
                MemoryHelper.compact();

                if (master == null) {
                    Logger.log("Saving master Activity!");
                    master = HelloWorld.this;
                }
            }
        }
       
        private Object3D loadModel(InputStream filename, float scale) {
            Loader.setVertexOptimization(false);
           
            Object3D[] model = Loader.load3DS(filename, scale);
            Object3D o3d = new Object3D(0);
            Object3D temp = null;

            for (int i = 0; i < model.length; i++) {
                temp = model[i];
                temp.setCenter(SimpleVector.ORIGIN);
                temp.rotateX((float)( -.5*Math.PI));
                temp.rotateY((float)(-Math.PI));
                temp.rotateMesh();
                temp.setRotationMatrix(new Matrix());
                o3d = Object3D.mergeObjects(o3d, temp);
       
            }
            o3d.build();
            return o3d;
    }
        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
        }

        public void onDrawFrame(GL10 gl) {
            try {
               
               
                selectAnyObjectAt((int) xpos, (int) ypos);
               
               
                if (!stop) {
                    //move();
                   
         cam = world.getCamera();
            cam.setPositionToCenter(cube);
            cam.align(cube);
            cam.rotateCameraY(0.0174532925f * 90f);
            cam.rotateCameraX((float) Math.toRadians(30));
            cam.moveCamera(Camera.CAMERA_MOVEOUT, 40);
         
            SimpleVector t = cube.getXAxis();
            t.scalarMul(move);
            moveRes.add(t);
           
            // avoid high speeds
            if (moveRes.length() > MAXSPEED) {
                moveRes.makeEqualLength(new SimpleVector(0, 0, MAXSPEED));
            }

            cube.translate(0, -0.02f, 0);

            moveRes = cube.checkForCollisionEllipsoid(moveRes, ellipsoid, 8);
            cube.translate(moveRes);

            // finally apply the gravity:
            //SimpleVector t = cube.getZAxis();
            SimpleVector tt = new SimpleVector(0, 1, 0);
            tt = cube.checkForCollisionEllipsoid(tt, ellipsoid, 1);
            cube.translate(tt);

            // damping
            if (moveRes.length() > DAMPING) {
                moveRes.makeEqualLength(new SimpleVector(0, 0, DAMPING));
            } else {
                moveRes = new SimpleVector(0, 0, 0);
            }
             
           
           
            fb.clear(back);
            world.renderScene(fb);
            world.draw(fb);
            blitNumber(lfps, 5, 5);
           
            fb.display();
           
           
            if (System.currentTimeMillis() - time >= 1000) {
                Logger.log(fps + "fps");
                lfps = fps;
                fps = 0;
                time = System.currentTimeMillis();
            }
            fps++;
                } else {
                    if (fb != null) {
                        fb.dispose();
                        fb = null;
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
                Logger.log("Drawing thread terminated!", Logger.MESSAGE);
            }
        }
       
        private void blitNumber(int number, int x, int y) {
            if (font != null) {
                String sNum = Integer.toString(number);

                for (int i = 0; i < sNum.length(); i++) {
                    char cNum = sNum.charAt(i);
                    int iNum = cNum - 48;
                    fb.blit(font, iNum * 5, 0, x, y, 5, 9, FrameBuffer.TRANSPARENT_BLITTING);
                    x += 5;
                }
            }
        }
    }
}




#18
Support / how to implement a start menu
February 12, 2014, 01:12:26 PM
how to implement a start menu
i need examples codes

this is good, but i don know implement
http://www.jpct.net/forum2/index.php/topic,2139.msg15977.html#msg15977
#19
Support / Re: collision example how helloword-ae
February 09, 2014, 05:03:52 PM
I got it :D

but can be improved?


package com.threed.jpct.example;

import java.lang.reflect.Field;

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 android.app.Activity;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MotionEvent;

import com.threed.jpct.Camera;
import com.threed.jpct.Config;
import com.threed.jpct.FrameBuffer;
import com.threed.jpct.Light;
import com.threed.jpct.Logger;
import com.threed.jpct.Object3D;
import com.threed.jpct.Primitives;
import com.threed.jpct.RGBColor;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.Texture;
import com.threed.jpct.World;
import com.threed.jpct.util.MemoryHelper;

/**
* A simple demo. This shows more how to use jPCT-AE than it shows how to write
* a proper application for Android. It includes basic activity management to
* handle pause and resume...
*
* @author EgonOlsen
*
*/
public class HelloWorld extends Activity {

// Used to handle pause and resume...
private static HelloWorld master = null;

private GLSurfaceView mGLView;
private MyRenderer renderer = null;
private FrameBuffer fb = null;
private World world = null;
private RGBColor back = new RGBColor(255, 0, 0);

private float touchTurn = 0;
private float touchTurnUp = 0;

private float xpos = -1;
private float ypos = -1;


//private int fps = 0;

private Light sun = null;

//------------------------
private Texture font = null;

private float move = 0;

private static final long serialVersionUID = 1L;

private static final float DAMPING = 0.1f;

private static final float SPEED = 1f;

private static final float MAXSPEED = 1f;

private Object3D plane = null;

private Object3D ramp = null;

private Object3D cube = null;

private Object3D cube2 = null;

private Object3D sphere = null;



private SimpleVector moveRes = new SimpleVector(0, 0, 0);

private SimpleVector ellipsoid = new SimpleVector(2, 2, 2);


protected void onCreate(Bundle savedInstanceState) {

Logger.log("onCreate");

if (master != null) {
copy(master);
}

super.onCreate(savedInstanceState);
mGLView = new GLSurfaceView(getApplication());

mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
// Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
// back to Pixelflinger on some device (read: Samsung I7500)
int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
EGLConfig[] configs = new EGLConfig[1];
int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});

renderer = new MyRenderer();
mGLView.setRenderer(renderer);
setContentView(mGLView);
}

@Override
protected void onPause() {
super.onPause();
mGLView.onPause();
}

@Override
protected void onResume() {
super.onResume();
mGLView.onResume();
}

@Override
protected void onStop() {
super.onStop();
}

private void copy(Object src) {
try {
Logger.log("Copying data from master Activity!");
Field[] fs = src.getClass().getDeclaredFields();
for (Field f : fs) {
f.setAccessible(true);
f.set(this, f.get(src));
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}

public boolean onTouchEvent(MotionEvent me) {

if (me.getAction() == MotionEvent.ACTION_DOWN) {
xpos = me.getX();
ypos = me.getY();
return true;
}

if (me.getAction() == MotionEvent.ACTION_UP) {
xpos = -1;
ypos = -1;
touchTurn = 0;
touchTurnUp = 0;
return true;
}

if (me.getAction() == MotionEvent.ACTION_MOVE) {
float xd = me.getX() - xpos;
float yd = me.getY() - ypos;

xpos = me.getX();
ypos = me.getY();

touchTurn = xd / -100f;
touchTurnUp = yd / -100f;
return true;
}

try {
Thread.sleep(15);
} catch (Exception e) {
// No need for this...
}

return super.onTouchEvent(me);
}
   


public boolean onKeyDown(int keyCode, KeyEvent msg) {
if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
move = 1f;
return true;
}

if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
move = -1f;
return true;
}

if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {
cube.rotateY((float) Math.toRadians(-1));
return true;
}

if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
cube.rotateY((float) Math.toRadians(1));
return true;
}



return super.onKeyDown(keyCode, msg);
}

public boolean onKeyUp(int keyCode, KeyEvent msg) {
if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
move = 0;
return true;
}

if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
move = 0;
return true;
}

if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {

return true;
}

if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {

return true;
}



return super.onKeyUp(keyCode, msg);
}


protected boolean isFullscreenOpaque() {
return true;
}

class MyRenderer implements GLSurfaceView.Renderer {
private int fps = 0;
private int lfps = 0;

private long time = System.currentTimeMillis();
private boolean stop = false;
public MyRenderer() {

Config.maxPolysVisible = 500;
         Config.farPlane = 1500;
         Config.glTransparencyMul = 0.1f;
         Config.glTransparencyOffset = 0.1f;
         Config.useVBO=true;
         
         Texture.defaultToMipmapping(false);
         Texture.defaultTo4bpp(true);
}
public void stop() {
stop = true;
}

public void onSurfaceChanged(GL10 gl, int w, int h) {
if (fb != null) {
fb.dispose();
}
fb = new FrameBuffer(gl, w, h);

if (master == null) {

world = new World();
world.setAmbientLight(20, 20, 20);

sun = new Light(world);
sun.setIntensity(250, 250, 250);
               
//keyMapper = new KeyMapper(this);

plane = Primitives.getPlane(20, 10);
plane.rotateX((float) Math.PI / 2f);

ramp = Primitives.getCube(20);
ramp.rotateX((float) Math.PI / 2f);

sphere = Primitives.getSphere(30);
sphere.translate(-50, 10, 50);

cube2 = Primitives.getCube(20);
cube2.translate(60, -20, 60);

cube = Primitives.getCube(2);
cube.translate(-50, -10, -50);

plane.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
ramp.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
sphere.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
cube2.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
cube.setCollisionMode(Object3D.COLLISION_CHECK_SELF);

world.addObject(plane);
world.addObject(ramp);
world.addObject(cube);
world.addObject(sphere);
world.addObject(cube2);
               
Light light = new Light(world);
light.setPosition(new SimpleVector(0, -80, 0));
light.setIntensity(140, 120, 120);
light.setAttenuation(-1);

world.setAmbientLight(20, 20, 20);

Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 100);
cam.moveCamera(Camera.CAMERA_MOVEUP, 100);
cam.lookAt(ramp.getTransformedCenter());

//long start = System.currentTimeMillis();
//long fps = 0;

SimpleVector sv = new SimpleVector();
sv.set(cube.getTransformedCenter());
sv.y -= 50;
sv.z -= 100;
sun.setPosition(sv);
MemoryHelper.compact();

if (master == null) {
Logger.log("Saving master Activity!");
master = HelloWorld.this;
}
}
}

public void onSurfaceCreated(GL10 gl, EGLConfig config) {
}

public void onDrawFrame(GL10 gl) {
try {

if (!stop) {
//move();

Camera cam = world.getCamera();
cam.setPositionToCenter(cube);
cam.align(cube);
cam.rotateCameraX((float) Math.toRadians(30));
cam.moveCamera(Camera.CAMERA_MOVEOUT, 40);
         
SimpleVector t = cube.getZAxis();
t.scalarMul(move);
moveRes.add(t);

// avoid high speeds
if (moveRes.length() > MAXSPEED) {
moveRes.makeEqualLength(new SimpleVector(0, 0, MAXSPEED));
}

cube.translate(0, -0.02f, 0);

moveRes = cube.checkForCollisionEllipsoid(moveRes, ellipsoid, 8);
cube.translate(moveRes);

// finally apply the gravity:
//SimpleVector t = cube.getZAxis();
SimpleVector tt = new SimpleVector(0, 1, 0);
tt = cube.checkForCollisionEllipsoid(tt, ellipsoid, 1);
cube.translate(tt);

// damping
if (moveRes.length() > DAMPING) {
moveRes.makeEqualLength(new SimpleVector(0, 0, DAMPING));
} else {
moveRes = new SimpleVector(0, 0, 0);
}



fb.clear(back);
world.renderScene(fb);
world.draw(fb);
blitNumber(lfps, 5, 5);

fb.display();


if (System.currentTimeMillis() - time >= 1000) {
Logger.log(fps + "fps");
lfps = fps;
fps = 0;
time = System.currentTimeMillis();
}
fps++;
} else {
if (fb != null) {
fb.dispose();
fb = null;
}
}
} catch (Exception e) {
e.printStackTrace();
Logger.log("Drawing thread terminated!", Logger.MESSAGE);
}
}

private void blitNumber(int number, int x, int y) {
if (font != null) {
String sNum = Integer.toString(number);

for (int i = 0; i < sNum.length(); i++) {
char cNum = sNum.charAt(i);
int iNum = cNum - 48;
fb.blit(font, iNum * 5, 0, x, y, 5, 9, FrameBuffer.TRANSPARENT_BLITTING);
x += 5;
}
}
}
}
}
#20
Support / Re: collision example how helloword-ae
February 08, 2014, 10:39:05 PM
this is perfect example, I've finally tested in jpct

http://www.jpct.net/wiki/index.php/Collision_detection

but in jpct-ae the code implementation is different



#21
Support / collision example how helloword-ae
February 08, 2014, 06:55:03 PM
Long time ago i not visited this site...

i search a simple example collision proyect android jpct-ae

-sphere down in plane (gravity) for example

-or move sphere and colide with cube for example

I am not able to implement, i read wiki

http://www.jpct.net/wiki/index.php/Collision_detection

I do not understand
#22
Support / Animate Textures
April 15, 2012, 09:57:40 PM
Is posible Animate textures?  ej(Video) or add html code in blitboard?
#25
Support / Re: jpct-ae 64 bit
March 28, 2012, 03:03:14 PM
Solved, copy folder android-sdk-windows and folder eclipse exactly, and uninstall the apk.
works perfect!!!!!
;D ;D 
#26
Support / Re: jpct-ae 64 bit
March 27, 2012, 01:51:58 PM
Sorry my English is not very good.

work all the android projects less the projects jpct-ae.

In windows 7 64 bit not working.

In Vista 32 bits is fine.
#27
Support / Re: jpct-ae 64 bit
March 27, 2012, 01:00:09 PM
Java Built Pach/Libraries

  • com.android.ide.eclipse.adt.LIBRARIES(unbound)
#28
Support / Re: jpct-ae 64 bit
March 27, 2012, 12:44:42 PM
Maybe in properties/Libraries.

com.android.ide.eclipse.adt.LIBRARIES(unbound)
#29
Support / jpct-ae 64 bit
March 27, 2012, 11:48:19 AM
The proyect  jpct-ae crash after install apk in my new machine 64bit.
The LogCat is

03-27 09:43:08.920: E/AndroidRuntime(437): FATAL EXCEPTION: main
03-27 09:43:08.920: E/AndroidRuntime(437): java.lang.NoClassDefFoundError: com.threed.jpct.RGBColor
03-27 09:43:08.920: E/AndroidRuntime(437):    at com.threed.jpct.example.HelloWorld.<init>(HelloWorld.java:50)
03-27 09:43:08.920: E/AndroidRuntime(437):    at java.lang.Class.newInstanceImpl(Native Method)
03-27 09:43:08.920: E/AndroidRuntime(437):    at java.lang.Class.newInstance(Class.java:1409)
03-27 09:43:08.920: E/AndroidRuntime(437):    at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
03-27 09:43:08.920: E/AndroidRuntime(437):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
03-27 09:43:08.920: E/AndroidRuntime(437):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-27 09:43:08.920: E/AndroidRuntime(437):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-27 09:43:08.920: E/AndroidRuntime(437):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-27 09:43:08.920: E/AndroidRuntime(437):    at android.os.Handler.dispatchMessage(Handler.java:99)
03-27 09:43:08.920: E/AndroidRuntime(437):    at android.os.Looper.loop(Looper.java:123)
03-27 09:43:08.920: E/AndroidRuntime(437):    at android.app.ActivityThread.main(ActivityThread.java:3683)
03-27 09:43:08.920: E/AndroidRuntime(437):    at java.lang.reflect.Method.invokeNative(Native Method)
03-27 09:43:08.920: E/AndroidRuntime(437):    at java.lang.reflect.Method.invoke(Method.java:507)
03-27 09:43:08.920: E/AndroidRuntime(437):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-27 09:43:08.920: E/AndroidRuntime(437):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-27 09:43:08.920: E/AndroidRuntime(437):    at dalvik.system.NativeStart.main(Native Method)


#30
Move Object A, and Colision with Object B, Object A Stop.