Browse Source

trapezkorrektur implementiert

Coole_verbesserung
poepelal78331 2 years ago
parent
commit
5aefc9c0b3
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      src/ofApp.cpp

+ 8
- 2
src/ofApp.cpp View File

message = out.str(); message = out.str();
ofDrawBitmapString(message, 100, 140); ofDrawBitmapString(message, 100, 140);
if (center_trapeze.x > middle) { if (center_trapeze.x > middle) {
center_rect.x = center_trapeze.x - (((center_trapeze.y - cp_top_right.y) / right_pitch));// * (((cp_bottom_right.x - middle) - ((center_trapeze.y - cp_top_right.y) / right_pitch)) / (center_trapeze.x - middle)));
float mid_to_dot = center_trapeze.x - middle;
float distance_to_rect = ((cp_bottom_right.y - center_trapeze.y) / right_pitch);
float mid_to_max = (cp_bottom_right.x - middle) - distance_to_rect;
center_rect.x = center_trapeze.x + ((distance_to_rect) * ((mid_to_dot)/(mid_to_max)));
} }
else { else {
center_rect.x = center_trapeze.x - (((center_trapeze.y - cp_top_left.y) / left_pitch));//* (((middle - cp_bottom_left.x) - ((center_trapeze.y - cp_top_left.y) / left_pitch)) / (middle - center_trapeze.x)));
float mid_to_dot = middle - center_trapeze.x;
float distance_to_rect = ((cp_bottom_left.y - center_trapeze.y) / left_pitch);
float mid_to_max = (middle - cp_bottom_left.x) - distance_to_rect;
center_rect.x = center_trapeze.x + ((distance_to_rect) * ((mid_to_dot)/(mid_to_max)));
} }
} }



Loading…
Cancel
Save