Back to project page min3d.
The source code is released under:
MIT License
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.
package com.min3d; //ww w . j av a2 s . c o m import 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.HollowCylinder; import com.min3d.lib.vos.TextureVo; /** * Demonstrates setting U/V texture wrapping * (TextureVo.repeatU and TextureVo.repeatV) * * @author Lee */ public class ExampleTextureWrap extends RendererActivity { Object3dContainer _object; TextureVo _texture; int _counter; public void initScene() { _object = new HollowCylinder(1f, 0.5f, 0.66f, 25); _object.normalsEnabled(false); _object.vertexColorsEnabled(false); scene.addChild(_object); Bitmap b = Utils.makeBitmapFromResourceId(R.drawable.uglysquares); Shared.textureManager().addTextureId(b, "texture", true); b.recycle(); _texture = new TextureVo("texture"); _object.textures().add(_texture); _counter = 0; } @Override public void updateScene() { _object.rotation().y = (float)(Math.sin(_counter*0.02f) * 45); if (_counter % 40 == 0) { _texture.repeatU = ! _texture.repeatU; } if (_counter % 80 == 0) { _texture.repeatV = ! _texture.repeatV; } _counter++; } }