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 ww w . j ava 2 s. c o m*/ import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import com.min3d.lib.core.Object3dContainer; import com.min3d.lib.core.RendererActivity; import com.min3d.lib.objectPrimitives.Box; import com.min3d.lib.vos.Light; /** * Example of adding an OpenGL scene within a conventional Android application layout. * Entails overriding RenderActivity's onCreateSetContentView() function, and * adding _glSurfaceView to the appropriate View... * * @author Lee */ public class ExampleInsideLayout extends RendererActivity implements View.OnClickListener { Object3dContainer _cube; @Override protected void onCreateSetContentView() { setContentView(R.layout.custom_layout_example); LinearLayout ll = (LinearLayout) this.findViewById(R.id.scene1Holder); ll.addView(_glSurfaceView); Button b; b = (Button) this.findViewById(R.id.layoutOkay); b.setOnClickListener(this); b = (Button) this.findViewById(R.id.layoutCancel); b.setOnClickListener(this); } public void onClick(View $v) { finish(); } // public void initScene() { scene.lights().add(new Light()); scene.backgroundColor().setAll(0xff444444); _cube = new Box(1,1,1); scene.addChild(_cube); } @Override public void updateScene() { _cube.rotation().y++; } }