Here's what we were given a year ago describing how a house record is saved inside the .agn file the Annotator program produces. It is wonderful insight into getting started but does not tell the full story.
House record:
4 bytes float: X position of first point
4 bytes float: Y position of first point
4 bytes float: X vector to the second point
4 bytes float: Y vector to the second point
4 bytes float: X position of third point
4 bytes float: Y position of third point
Values of position are -0.5 for left or upper side and 0.5 for bottom or right side. That means that upper left corener has value of <-0.5,-0.5>, center has value of <0,0> and upper right has value of <0.5,-0.5>.
Vectors have values from 0 to 1. Vector < 1,0 > means horizontal line, vector < 0,1 > vertical line, vector < 0.5,0.5 > means line with angle 45 deg from upper left to lower right.
The person was right on in describing the first 4 byte sets. The first 8 bytes truly contain the actual X and Y coordinates (from -.5 to .5) of the first point of the rectangle describing the house. The second 8 bytes truly do contain the X and Y vector info of the direction to the second point of that rectangle. The last 8 bytes however are not the actual positions of the 3rd point necessary to describe the full box but instead, the offset amounts from the first point to that third point. Depending on the values of the point 2 X and Y vectors, those offset values are either added to or subtracted from the point 1 coordinates to locate the third point. Now, having said that, this only works for boxes drawn horizontally and vertically.
Using that logic I was able to exactly reproduce the same boxes Annotator shows on their image on the image I intend to use as a backdrop for editing.
Once I put an angled house object in Annotator, all the rules stopped working. The first 8 bytes still accurately depict the point one coordinates. The second eight bytes contain the sin and cosine values of the angle from the first point to the second point. One can only however get the direction from those values, not the actual 2nd point of the box. The last two bytes also appear to be offset values but here's where my dilemna occurs. No matter how I combine those supposed offsets to the Point 1 positions or adjust them mathematically with the vector amounts, I can't get a point 3 to line up with where it should be any other corner of the box. I've tried multiplying the offsets by the sin or cosine values, dividing by them, adding and subtracting them. Next step will be looking at other trig functions based on those sin and cosine values and using those for adjustments. This is pretty daunting.
What scares me is that obviously others have been tempted into this minefield before and we have never seen an alternative produced. Have I found the point where everyone in the past has gotten blocked and just given up? Man, I could use some brainstorming help here. No suggestion is off the table at this point.
Art Martin
House record:
4 bytes float: X position of first point
4 bytes float: Y position of first point
4 bytes float: X vector to the second point
4 bytes float: Y vector to the second point
4 bytes float: X position of third point
4 bytes float: Y position of third point
Values of position are -0.5 for left or upper side and 0.5 for bottom or right side. That means that upper left corener has value of <-0.5,-0.5>, center has value of <0,0> and upper right has value of <0.5,-0.5>.
Vectors have values from 0 to 1. Vector < 1,0 > means horizontal line, vector < 0,1 > vertical line, vector < 0.5,0.5 > means line with angle 45 deg from upper left to lower right.
The person was right on in describing the first 4 byte sets. The first 8 bytes truly contain the actual X and Y coordinates (from -.5 to .5) of the first point of the rectangle describing the house. The second 8 bytes truly do contain the X and Y vector info of the direction to the second point of that rectangle. The last 8 bytes however are not the actual positions of the 3rd point necessary to describe the full box but instead, the offset amounts from the first point to that third point. Depending on the values of the point 2 X and Y vectors, those offset values are either added to or subtracted from the point 1 coordinates to locate the third point. Now, having said that, this only works for boxes drawn horizontally and vertically.
Using that logic I was able to exactly reproduce the same boxes Annotator shows on their image on the image I intend to use as a backdrop for editing.
Once I put an angled house object in Annotator, all the rules stopped working. The first 8 bytes still accurately depict the point one coordinates. The second eight bytes contain the sin and cosine values of the angle from the first point to the second point. One can only however get the direction from those values, not the actual 2nd point of the box. The last two bytes also appear to be offset values but here's where my dilemna occurs. No matter how I combine those supposed offsets to the Point 1 positions or adjust them mathematically with the vector amounts, I can't get a point 3 to line up with where it should be any other corner of the box. I've tried multiplying the offsets by the sin or cosine values, dividing by them, adding and subtracting them. Next step will be looking at other trig functions based on those sin and cosine values and using those for adjustments. This is pretty daunting.
What scares me is that obviously others have been tempted into this minefield before and we have never seen an alternative produced. Have I found the point where everyone in the past has gotten blocked and just given up? Man, I could use some brainstorming help here. No suggestion is off the table at this point.
Art Martin



