Android的3D引擎:Rajawali
jopen
11年前
Rajawali是一个用于Android应用的3D引擎,基于 OpenGL ES 2.0。它可以用于普通的应用程序,以及实时壁纸。
package rajawali.tutorials; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import rajawali.Camera2D; import rajawali.primitives.Plane; import rajawali.renderer.RajawaliRenderer; import android.content.Context; public class Rajawali2DExampleRenderer extends RajawaliRenderer { private float mTime; private CustomMaterial mCustomMaterial; public Rajawali2DExampleRenderer(Context context) { super(context); setCamera(new Camera2D()); setFrameRate(30); mTime = 0; } @Override public void initScene() { super.initScene(); mCustomMaterial = new CustomMaterial(); Plane plane = new Plane(1, 1, 1, 1, 1); plane.setMaterial(mCustomMaterial); addChild(plane); } @Override public void onDrawFrame(GL10 glUnused) { super.onDrawFrame(glUnused); mTime += .2f; mCustomMaterial.setTime(mTime); } }