예제 #1
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);
    }
예제 #2
0
 @Override
 protected void onRender(long ellapsedRealtime, double deltaTime) {
   super.onRender(ellapsedRealtime, deltaTime);
   getCurrentCamera().rotate(Vector3.Axis.Y, -0.2);
 }