1
Support / Re: Problem with rotating a box.
« on: September 12, 2012, 08:42:45 am »
Thank you. The emulator was the problem.
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.
InputStream objStream1 = getResources().openRawResource( getResources().getIdentifier( "com.threed.jpct.example:raw/box_obj", null, null ) );
InputStream mtlStream1 = getResources().openRawResource( getResources().getIdentifier( "com.threed.jpct.example:raw/box_mtl", null, null ) );
box = com.threed.jpct.Loader.loadOBJ( objStream1, mtlStream1, 3.0f )[0];
if ( null != box )
{
//box.invert();
box.setCulling( Object3D.CULLING_DISABLED );
box.setEnvmapped( Object3D.ENVMAP_DISABLED );
box.setTexture( "texture" );
//box.calcNormals();
box.rotateX( 90 );
box.build();
box.compile();
world.addObject(box);
box.translate( 0.f, 0.f, 0.f );
}
InputStream is = getResources().openRawResource(R.drawable.grid);
Bitmap bitmap = BitmapFactory.decodeStream(is);
Texture texture = new Texture(bitmap);
TextureManager.getInstance().addTexture("texture", texture);
and set it with box.setTexture( "texture" );