There already was a topic about running b3d on android. I decided to post some work i am doing making a simple extension of the JPCT-AE 3d Library for Android development. Basically it simplifies most of the commands down to the more familiar blitz3d functions. Still a WIP but i've been able to progress pretty fast with it.
Here is the official Google code url http://code.google.com/p/b3d-jpct-vgl/
Making a wiki as i go documenting what functions are implemented and how to get started.
Here is a little screeny loading an Md2 file and rotating the model in a loop.

and the code used to make it.
package myvr.vgl.main;
import java.io.IOException;
import com.threed.jpct.Camera;
import com.threed.jpct.Light;
import com.threed.jpct.Object3D;
import com.threed.jpct.Texture;
import vgl.b3d.jpct.JB3D;
public class MyBirdDemo extends JB3D {
public Camera cam;
public Object3D bird;
public Texture tex;
public Light lit;
public void b3dloop()
{
TurnEntity(bird,0.01f,0.01f,0.01f);
}
public void initB3d()
{
cam = CreateCamera();
AmbientLight(200,200,200);
try {
bird = LoadMesh("Bird.md2");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
lit = CreateLight(0);
try {
tex = LoadTexture("Bird.bmp", 0);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(tex.toString());
if(tex!=null)
{
EntityTexture(bird,tex);
}
PositionEntity(cam,0.0f,0.0f,-25.0f);
//soon to change this to blitz's equivalent..
cam.lookAt(bird.getTransformedCenter());
}
}
|