We can define a truncated pyramid which includes the tool displacement volume by setting the camera parameters according to the tool’s fixed point, latest and current moving extremity position. Left and right planes are defined to match respectively the tool’s latest and current position.
Top and bottom matches the tool’s section.
At this step, we defined a truncated pyramid but we only want a slice of this pyramid. In the vertical direction, the viewing volume is much too large, especially in the far plane region.
OpenGL provides a functionality which allows us to remove half spaces from the viewing volumes : the clipping planes.
That’s what we use to define a viewing volume that matches the volume described by the tool during one time step of simulation.