From 8e004230a7c8f3b68eeb845616b3f29c920cefc4 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 4 Feb 2023 00:29:31 +0100 Subject: [PATCH] embeddings:: 3d-models:: fixed animate_bird --- 3d-models.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/3d-models.cpp b/3d-models.cpp index 60097a92..ce263457 100644 --- a/3d-models.cpp +++ b/3d-models.cpp @@ -632,11 +632,15 @@ void geometry_information::animate_bird(hpcshape& orig, hpcshape_animated& anima clone_shape(orig, tgt); ld alpha = cos(M_PI * i / WINGS) * 30 * degree; for(int i=tgt.s; i body) { - ld off = hpc[i][1] > 0 ? body : -body; - hpc[i][2] += abs(hpc[i][1] - off) * sin(alpha); - hpc[i][1] = off + (hpc[i][1] - off) * cos(alpha); - hpc[i] = normalize(hpc[i]); + hyperpoint h = hpc[i]; + h = cgi.emb->actual_to_logical(hpc[i]); + if(abs(h[1]) > body) { + ld off = h[1] > 0 ? body : -body; + h[2] += abs(h[1] - off) * sin(alpha); + h[1] = off + (h[1] - off) * cos(alpha); + h = cgi.emb->logical_to_actual(h); + h = normalize(h); + hpc[i] = h; } } }