Can some explain what the difference between this options? Because the documentation is not clear how the ellipse will be transformed when performing collision detection with ELLIPSOID_TRANSFORMED options.
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
package com.amulet_it.openglexample;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.content.Context;
import android.graphics.Color;
import android.graphics.PointF;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.widget.Toast;
import com.threed.jpct.Camera;
import com.threed.jpct.FrameBuffer;
import com.threed.jpct.Interact2D;
import com.threed.jpct.Light;
import com.threed.jpct.Loader;
import com.threed.jpct.Matrix;
import com.threed.jpct.Object3D;
import com.threed.jpct.Primitives;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.Texture;
import com.threed.jpct.TextureManager;
import com.threed.jpct.World;
import java.io.InputStream;
import java.util.HashMap;
public class MyRenderer implements GLSurfaceView.Renderer {
private Context mContext = null;
private FrameBuffer fb = null;
private World world = null;
private Camera cam = null;
public MyRenderer(Context context) {
mContext = context;
}
@Override
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
}
@Override
public void onSurfaceChanged(GL10 unused, int width, int height) {
if ( fb != null ) {
fb.dispose();
}
fb = new FrameBuffer(width, height);
world = new World();
cam = world.getCamera();
InputStream objStream = mContext.getResources().openRawResource(R.raw.test_obj);
Object3D[] loadRes = Loader.loadOBJ(objStream, null, 3);
Object3D cube = loadRes[0];
cube.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS | Object3D.COLLISION_CHECK_SELF);
cube.build();
world.addObject(cube);
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.moveCamera(Camera.CAMERA_MOVEOUT, 200);
cam.moveCamera(Camera.CAMERA_MOVEUP, 200);
cam.lookAt(cube.getTransformedCenter());
}
@Override
public void onDrawFrame(GL10 unused) {
fb.clear(Color.RED);
world.renderScene(fb);
world.draw(fb);
fb.display();
}
}
Page created in 0.011 seconds with 8 queries.