summaryrefslogtreecommitdiffhomepage
path: root/pose-widget/pose-widget.hpp
diff options
context:
space:
mode:
authorGO63-samara <go1@list.ru>2020-09-20 02:48:57 +0400
committerGO63-samara <go1@list.ru>2020-09-20 02:48:57 +0400
commit354fff96ffa06753c69a721ad017d621e95927d0 (patch)
tree84873890118ee984b311b24b373c3d46f808b522 /pose-widget/pose-widget.hpp
parent1f280196bd4807ac33c4e8d939db09c8fdd7c6a4 (diff)
Fix display of the Octopus pose in the Pose-widget.
In the extreme version of OpenTrack-2.3.12, the Octopus pose is still displayed incorrectly. I have fixed pose-widget. A video of the corrected pose-widget is available here: https://youtu.be/my4_VOwGmq4 Fixed bugs: - The turns and movements of the Octopussy are now performed truly independently of each other, as it should be in 6DOF. - When cornering, there is no "gimbal lock" at Pitch = +/- 90 degrees. - Fixed directions of axes of rotations and positions. Now the Octopus pose displays the actual direction of view on the plane. - Fixed display of the back (green) surface of the Octopus. Previously, it was displayed mirrored. Additional features: - Applied "perspective projection", the picture becomes more voluminous. - Added lighting effect from above, with the same purpose. - Added background fill for the widget. This makes it possible to see the borders of the widget. - Added X and Y axes. This helps to estimate how far the Octopus is deviated from the center. - Added [Mirror] checkbox, mirroring positions and rotations. It is often more convenient to observe the Octopussy's mirror pose. - If before compilation in the file "pose-widget.hpp" include line 19: "#define TEST", then a rectangular frame will be drawn around the Octopus. This is useful when testing a pose-widget to assess distortion and size.
Diffstat (limited to 'pose-widget/pose-widget.hpp')
-rw-r--r--pose-widget/pose-widget.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/pose-widget/pose-widget.hpp b/pose-widget/pose-widget.hpp
index b3267ff9..49044d93 100644
--- a/pose-widget/pose-widget.hpp
+++ b/pose-widget/pose-widget.hpp
@@ -14,7 +14,9 @@
#include <QWidget>
#include <QImage>
+#include <QCheckBox>
+//#define TEST
namespace pose_widget_impl {
using namespace euler;
@@ -25,13 +27,17 @@ public:
pose_widget(QWidget *parent = nullptr);
void present(double xAngle, double yAngle, double zAngle, double x, double y, double z);
QSize sizeHint() const override;
-
+ QCheckBox mirror{QCheckBox{"Mirror", this}};
private:
+ void resizeEvent(QResizeEvent *event) override;
void paintEvent(QPaintEvent*) override;
Pose_ R, T;
QImage front{QImage{":/images/side1.png"}.convertToFormat(QImage::Format_ARGB32)};
- QImage back{QImage{":/images/side6.png"}.convertToFormat(QImage::Format_ARGB32)};
+ QImage back {QImage{":/images/side6.png"}.convertToFormat(QImage::Format_ARGB32)
+ .mirrored(true,false)};
+ QImage shine {QImage{front.width(), front.height(), QImage::Format_ARGB32}};
+ QImage shadow{QImage{front.width(), front.height(), QImage::Format_ARGB32}};
};
}