aboutsummaryrefslogtreecommitdiff
path: root/calibrate.c
diff options
context:
space:
mode:
authorMichael Turvey <mwturvey@users.noreply.github.com>2017-12-28 08:59:07 -0700
committerGitHub <noreply@github.com>2017-12-28 08:59:07 -0700
commit8c5ee18e12847dd01290025bd138a1a029f1caf8 (patch)
tree59e237db42481f79acae0eee79d81f345eb7e105 /calibrate.c
parent6ebd39ca34351f6ac1df1d1f1c3a518784dd18e4 (diff)
parent8eda10ed94b66a8bb388cc5710dc6b45b1901993 (diff)
downloadlibsurvive-8c5ee18e12847dd01290025bd138a1a029f1caf8.tar.gz
libsurvive-8c5ee18e12847dd01290025bd138a1a029f1caf8.tar.bz2
Merge pull request #86 from mwturvey/MakeTrackingGood
Make tracking good
Diffstat (limited to 'calibrate.c')
-rw-r--r--calibrate.c70
1 files changed, 60 insertions, 10 deletions
diff --git a/calibrate.c b/calibrate.c
index 88f8288..cfd3e17 100644
--- a/calibrate.c
+++ b/calibrate.c
@@ -207,9 +207,9 @@ void DisplayPose(SurvivePose pose, size_t xResolution, size_t yResolution)
CNFGTackSegment(
(short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp1out[0]),
- yResolution-(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp1out[1]),
+ (short)yResolution-(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp1out[1]),
(short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp2out[0]),
- yResolution -(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp2out[1]));
+ (short)yResolution -(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp2out[1]));
}
// line for the (0,-y) to (0,+y))
@@ -233,9 +233,9 @@ void DisplayPose(SurvivePose pose, size_t xResolution, size_t yResolution)
CNFGTackSegment(
(short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp1out[0]),
- yResolution -(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp1out[1]),
+ (short)yResolution -(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp1out[1]),
(short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp2out[0]),
- yResolution -(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp2out[1]));
+ (short)yResolution -(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp2out[1]));
}
// Small line to indicate (0,+y)
@@ -245,23 +245,73 @@ void DisplayPose(SurvivePose pose, size_t xResolution, size_t yResolution)
FLT tmp2[3];
FLT tmp2out[3];
- tmp1[1] = minRectSize + ((pose.Pos[2] * 40.0));
+ tmp1[1] = minRectSize + ((pose.Pos[2] * 40.0)*1.3);
tmp1[2] = 0;
- tmp1[0] = tmp1[1] * 0.3;
+ tmp1[0] = ((pose.Pos[2] * 40.0)) * 0.3;
quatrotatevector(tmp1out, pose.Rot, tmp1);
- tmp2[1] = minRectSize + ((pose.Pos[2] * 40.0));
+ tmp2[1] = minRectSize + ((pose.Pos[2] * 40.0)*0.7);
+ tmp2[2] = 0;
+ tmp2[0] = -(((pose.Pos[2] * 40.0)) * 0.3);
+
+ quatrotatevector(tmp2out, pose.Rot, tmp2);
+
+ CNFGTackSegment(
+ (short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp1out[0]),
+ (short)yResolution - (short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp1out[1]),
+ (short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp2out[0]),
+ (short)yResolution - (short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp2out[1]));
+ }
+ // Small line to indicate (+x,0)
+ {
+ FLT tmp1[3];
+ FLT tmp1out[3];
+ FLT tmp2[3];
+ FLT tmp2out[3];
+
+ tmp1[0] = minRectSize + ((pose.Pos[2] * 40.0)*1.3);
+ tmp1[2] = 0;
+ tmp1[1] = tmp1[0] * 0.3;
+
+ quatrotatevector(tmp1out, pose.Rot, tmp1);
+
+ tmp2[0] = minRectSize + ((pose.Pos[2] * 40.0)*.7);
+ tmp2[2] = 0;
+ tmp2[1] = -(tmp1[0] * 0.3);
+
+ quatrotatevector(tmp2out, pose.Rot, tmp2);
+
+ CNFGTackSegment(
+ (short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp1out[0]),
+ (short)yResolution - (short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp1out[1]),
+ (short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp2out[0]),
+ (short)yResolution - (short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp2out[1]));
+ }
+ // Small line to indicate (+x,0)
+ {
+ FLT tmp1[3];
+ FLT tmp1out[3];
+ FLT tmp2[3];
+ FLT tmp2out[3];
+
+ tmp1[0] = minRectSize + ((pose.Pos[2] * 40.0)*.7);
+ tmp1[2] = 0;
+ tmp1[1] = tmp1[0] * 0.3;
+
+ quatrotatevector(tmp1out, pose.Rot, tmp1);
+
+ tmp2[0] = minRectSize + ((pose.Pos[2] * 40.0)*1.3);
tmp2[2] = 0;
- tmp2[0] = -(tmp1[1] * 0.3);
+ tmp2[1] = -(tmp1[0] * 0.3);
quatrotatevector(tmp2out, pose.Rot, tmp2);
CNFGTackSegment(
(short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp1out[0]),
- yResolution -(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp1out[1]),
+ (short)yResolution - (short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp1out[1]),
(short)(windowCenterX + (pose.Pos[0] * sizeScale) + tmp2out[0]),
- yResolution -(short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp2out[1]));
+ (short)yResolution - (short)(windowCenterY + (pose.Pos[1] * sizeScale) + tmp2out[1]));
}