Heading: 0°, elevation 0°
[attachment=13751:0 heading, 0 elevation.png]
Heading: 90°, elevation 0°
[attachment=13752:90 heading, 0 elevation.png]
Heading 0°, elevation 90°
[attachment=13753:0 heading, 90 elevation.png]
Heading 90°, elevation 90°
[attachment=13754:90 heading, 90 elevation.png]
Heading 45°, elevation 45°
[attachment=13755:45 heading, 45 elevation.png]
As you can see the edge cases work but not the middle. Which kind of makes sense if you think about it, at the edge cases the box is perpendicular to the camera and everything is great.
(Grey is box, orange is camera, red is distance)
But in the middle cases, the box is no longer perpendicular to the camera and gaps are introduced. Not only that but the distance isn't the same.
(Grey is box, orange is camera, red is distance if the camera was perpendicular, pink is actual distance and black is gaps introduced from the box's rotatation).
The black gaps aren't an issue since I'll be moving the camera closer and therefore eliminate them; however the trig I'm using is assuming I'm perpendicular to the box. So the distance I'm calculating is the red line but I'm applying it to the pink line.