Load 3d object in Android using JPCT Engine
by mariganesh[ Edit ] 2014-02-15 19:18:15
Load 3d object in Android using JPCT Engine
If you create texture and load 3d object using jpct in android.please use the following code.
/* Create texture for grass */
private World world = null;
private Object3D grass = null;
world = new World();//intialize full screen
TextureManager tm = TextureManager.getInstance();
Texture grass2 = new Texture(res.openRawResource(R.raw.grassy)); //grass jpg image
tm.addTexture("grass2", grass2); // add texture
grass = Loader.load3DS(res.openRawResource(R.raw.grass), 15f)[0]; //Load 3d object for grass
grass.setTexture("grass2"); //set texture
grass.translate(-14, -17, -50); // set grass postion on screen
world.addObject(grass); //add grass to screen