public void onDrawFrame(GL10 glUnused) { super.onDrawFrame(glUnused); // -- no proper physics here, just a bad approximation to keep // this example as short as possible ;-) mRaptor.setZ(mRaptor.getZ() + 2f); mRaptor.setX((float) Math.sin(mTime) * 20f); mRaptor.setRotZ((float) Math.sin(mTime + 8f) * -30f); mRaptor.setRotY(180 + (mRaptor.getRotZ() * .1f)); mRaptor.setRotY(180); mRaptor.setY((float) Math.cos(mTime) * 10f); mRaptor.setRotX((float) Math.cos(mTime + 1f) * -20f); mSphere.setZ(mRaptor.getZ()); mTime += .01f; if (mRootCube.getZ() - mRaptor.getZ() <= (30 * -6)) { mRootCube.setZ(mRaptor.getZ()); } }
@Override public void onDrawFrame(GL10 glUnused) { super.onDrawFrame(glUnused); mTileCube.setRotY(mTileCube.getRotY() + 1); mTileSphere.setRotY(mTileSphere.getRotY() + 1); }