If you think the Android project min3d listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.min3d;
//fromwww.java2s.comimport android.graphics.Bitmap;
import com.min3d.lib.Shared;
import com.min3d.lib.Utils;
import com.min3d.lib.core.Object3dContainer;
import com.min3d.lib.core.RendererActivity;
import com.min3d.lib.objectPrimitives.Box;
import com.min3d.lib.vos.Light;
/**
* Demonstrates visual difference between a texture with mipmapping versus a texture without.
* The cube without the mipmapped texture displays distracting, aliasing artifacts.
*
* Note how mipmapping is set on or off at the TextureManager level.
* (It is not controlled at the Object3d level, or the TextureVO level)
*
* Mipmapping requires the target hardware to support OpenGL ES 1.1.
* If it does not, the request to generate the MIP maps is ignored.
*/publicclass ExampleMipMap extends RendererActivity
{
Object3dContainer _holder;
Object3dContainer _cubeWithMipMap;
Object3dContainer _cubeWithoutMipMap;
publicvoid initScene()
{
scene.lights().add(new Light());
_holder = new Object3dContainer(0, 0);
scene.addChild(_holder);
_cubeWithMipMap = new Box(1.5f,1.5f,1.5f);
_cubeWithMipMap.position().y = 1f;
_holder.addChild(_cubeWithMipMap);
_cubeWithoutMipMap = new Box(1.5f,1.5f,1.5f);
_cubeWithoutMipMap.position().y = -1f;
_holder.addChild(_cubeWithoutMipMap);
//
Bitmap b = Utils.makeBitmapFromResourceId(this, R.drawable.checkerboard);
Shared.textureManager().addTextureId(b, "checkerboard_with_mipmap", true);
Shared.textureManager().addTextureId(b, "checkerboard_without_mipmap", false);
_cubeWithMipMap.textures().addById("checkerboard_with_mipmap");
_cubeWithoutMipMap.textures().addById("checkerboard_without_mipmap");
b.recycle();
}
@Override
publicvoid updateScene()
{
_holder.rotation().y +=1;
_holder.rotation().z +=.25;
}
}