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; //from w w w . j a v a 2 s .co m import com.min3d.lib.IParser; import com.min3d.lib.Parser; import com.min3d.lib.core.Object3dContainer; import com.min3d.lib.core.RendererActivity; import com.min3d.lib.vos.Light; public class ExampleLoad3DSFile extends RendererActivity { private final float CAM_RADIUS_X = 20; private final float CAM_RADIUS_Y = 15; private final float CAM_RADIUS_Z = 30; private final float ROTATION_SPEED = 1; private Object3dContainer monster; private float degrees; @Override public void initScene() { scene.lights().add(new Light()); IParser parser = Parser.createParser(Parser.Type.MAX_3DS, getResources(), R.raw.monster_high, getPackageName(), false); parser.parse(); monster = parser.getParsedObject(); monster.scale().x = monster.scale().y = monster.scale().z = .5f; monster.position().y = -10; scene.addChild(monster); scene.camera().target = monster.position(); } @Override public void updateScene() { float radians = degrees * ((float)Math.PI / 180); scene.camera().position.x = (float)Math.cos(radians) * CAM_RADIUS_X; scene.camera().position.y = (float)Math.sin(radians) * CAM_RADIUS_Y; scene.camera().position.z = (float)Math.sin(radians) * CAM_RADIUS_Z; degrees += ROTATION_SPEED; } }