diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2020-02-03 21:47:45 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2020-02-03 21:47:45 +0100 |
commit | 9c974ebc46046b2fcaddf51e924c8b23ed20367a (patch) | |
tree | 51a24b868bc00a3b21316bbc109ff73c66ac6c9c | |
parent | 3dadc95e5b7b9ab0f50e4c977f63167cf30da852 (diff) |
pose-widget: make octopus less wide
Now it looks less like a frog.
-rw-r--r-- | pose-widget/pose-widget.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp index 53bf214f..3ad475cf 100644 --- a/pose-widget/pose-widget.cpp +++ b/pose-widget/pose-widget.cpp @@ -38,7 +38,8 @@ void pose_widget::paintEvent(QPaintEvent*) ? back : front; - int w = img.width(), h = img.height(); + constexpr double scale = .75; + int w = img.width(), h = iround(img.height()*scale); QTransform t; @@ -47,15 +48,15 @@ void pose_widget::paintEvent(QPaintEvent*) constexpr double z_scale = 1./250; constexpr double xy_scale = .0075; double xy = std::sqrt(w*w + h*h) * xy_scale; + double sx = clamp(.4 + -z * z_scale, .1, 2), sy = sx * 1/scale; - double s = clamp(.4 + -z * z_scale, .1, 2); - t.scale(s, s); + t.scale(sx, sy); t.rotate(pitch, Qt::XAxis); t.rotate(yaw, Qt::YAxis); t.rotate(roll, Qt::ZAxis); - t.translate(x * xy / s, y * xy / s); + t.translate(x * xy / sx, y * xy / sy); t.translate(w*-.5, h*-.5); |