Skip to content

Commit

Permalink
Draw4: camera rotate hitting face
Browse files Browse the repository at this point in the history
  • Loading branch information
DysaniazzZ committed Feb 23, 2018
1 parent 3878dd6 commit 77ad905
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.graphics.Point;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.animation.LinearInterpolator;

Expand Down Expand Up @@ -47,6 +48,10 @@ public Practice13CameraRotateHittingFaceView(Context context, @Nullable Attribut
animator.setDuration(5000);
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(ValueAnimator.INFINITE);

DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
float newZ = - displayMetrics.density * 6;
camera.setLocation(0, 0, newZ); // 将相机向后移动
}

@Override
Expand Down

0 comments on commit 77ad905

Please sign in to comment.