From d5109fc3bba6dc17d23c7279d4f9e2633533b734 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 3 Jul 2019 05:01:27 +0200 Subject: [PATCH] maTranslationRotation animation --- screenshot.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/screenshot.cpp b/screenshot.cpp index f2f0f458..708c7246 100644 --- a/screenshot.cpp +++ b/screenshot.cpp @@ -474,7 +474,7 @@ void menu() { namespace anims { enum eMovementAnimation { - maNone, maTranslation, maRotation, maCircle, maParabolic + maNone, maTranslation, maRotation, maCircle, maParabolic, maTranslationRotation }; eMovementAnimation ma; @@ -614,6 +614,14 @@ void apply() { View = spin(movement_angle * degree) * View; } break; + + case maTranslationRotation: + View = cspin(0, DIM-1, movement_angle * degree) * ypush(shift_angle * degree) * xpush(cycle_length * t / period) * ypush(-shift_angle * degree) * + cspin(0, DIM-1, -movement_angle * degree) * View; + moved(); + View = spin(2 * M_PI * t / period) * View; + break; + #if CAP_BT case maParabolic: reflect_view(); @@ -823,6 +831,7 @@ void show() { rotation_center_c = centerover; rotation_center_View = View; }); + dialog::addBoolItem_choice(XLAT("translation")+"+"+XLAT("rotation"), ma, maTranslationRotation, '5'); switch(ma) { case maCircle: { animator(XLAT("circle spins"), circle_spins, 'C'); @@ -853,6 +862,7 @@ void show() { break; } case maTranslation: + case maTranslationRotation: case maParabolic: { if(ma == maTranslation && conformal::on) dialog::addBreak(300); @@ -1013,6 +1023,12 @@ int readArgs() { shift_arg_formula(shift_angle); shift_arg_formula(movement_angle); } + else if(argis("-animmoverot")) { + ma = maTranslationRotation; + shift_arg_formula(cycle_length); + shift_arg_formula(shift_angle); + shift_arg_formula(movement_angle); + } else if(argis("-animpar")) { ma = maParabolic; shift_arg_formula(parabolic_length);