コード例 #1
0
    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());
      }
    }
コード例 #2
0
    @Override
    protected void onRender(long ellapsedRealtime, double deltaTime) {
      // -- no proper physics here, just a bad approximation to keep
      // this example as short as possible ;-)
      mRaptor.setZ(mRaptor.getZ() + 2.0);
      mRaptor.setX(Math.sin(mTime) * 20.0);
      // mRaptor.setRotZ(Math.sin(mTime + 8.0) * -30.0);
      // mRaptor.setRotY(180 + (mRaptor.getRotZ() * 0.1));
      // mRaptor.setRotY(180);
      mRaptor.setY(Math.cos(mTime) * 10.0);
      mRaptor.setRotX(Math.cos(mTime + 1.0) * -20.0);

      mSphere.setZ(mRaptor.getZ());
      mTime += 0.01;

      if (mRootCube.getZ() - mRaptor.getZ() <= (30 * -6)) {
        mRootCube.setZ(mRaptor.getZ());
      }

      mPointLight.setPosition(getCurrentCamera().getPosition());
      mPointLight.setLookAt(mRaptor.getWorldPosition());
      super.onRender(ellapsedRealtime, deltaTime);
    }
コード例 #3
0
 @Override
 protected void onRender(long ellapsedRealtime, double deltaTime) {
   super.onRender(ellapsedRealtime, deltaTime);
   getCurrentCamera().rotate(Vector3.Axis.Y, -0.2);
 }
コード例 #4
0
 @Override
 public void onDrawFrame(GL10 glUnused) {
   super.onDrawFrame(glUnused);
   mTileCube.setRotY(mTileCube.getRotY() + 1);
   mTileSphere.setRotY(mTileSphere.getRotY() + 1);
 }