4
« on: September 08, 2010, 09:14:28 am »
My full code
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
TextureManager.getInstance().flush();
world = new World();
res = getResources();
TextureManager.getInstance().addTexture("bw2",
new Texture(res.openRawResource(R.raw.bw2)));
boxgfx = Loader.load3DS(res.openRawResource(R.raw.obj), 50)[0];
boxgfx.setTexture("bw2");
boxgfx.rotateX((float) Math.PI/2);
boxgfx.translate(new SimpleVector(0,0,0));
world.getCamera().setPosition(150, -50, -5);
cameraPosition = new Vector3f(150, -50, -5);
cameraTargetPosition = new Vector3f(0, 0, 0);
world.getCamera().lookAt(0,0,0);
Light light = new Light(world);
light.setPosition(new SimpleVector(-200, -50, 80));
}