Brian, I have a couple of OpenGL questions for you. In your lookahead code you rotate the world according to the implement's heading, then you translate to the location of the tractor. The effect of this is to have the camera looking down on the field at the location of the tractor, but rotated according to the heading. Then you can use the ReadPixels calls to look effectively behind the tractor (in front of the implement) at spots that are where the implement would be in various subdivisions of the lookahead time * velocity. Is that a correct understanding?
Also. the GL transforms are cumulative right? In other words, once a world is rotated, the translations are now relative to that new rotation? If so, wouldn't it be correct to translate first to the tractor location and then rotate the world to the heading? What am I missing? EDIT: no I'm not right.
So what I'd like to try is to implement a lookahead that looks something like this. I've written code to track the rate of change of the heading so that during a turn we can predict the heading a second or two into the future. I'd like to try to make the lookahead code then look down the present heading however many seconds, and rotate to a new predicted heading. That should account for the booms going backwards on a turn. I think I could do it by doing some translations and rotations, but it must not be a simple thing after your initial rotation and translation because everything I try is not what I want! I've moved your hidden OpenGL widget out into the open so I can see what it's doing. Any advice for me on this? I think my problem is lying with not fully understanding how OpenGL coordinates are working.
Last edited by torriem; 11-11-2016 at 12:49 AM.