I'm currently writing a part of a vtk application where it is necessary to have a 'brushing' type of overlay on top of  the contents of a renderwindow.<br><br>The idea is that one can switch between moving the camera around, and a so-called 'brushing mode'. In this mode two dimensional shapes can be drawn (as annotations for example) directly on the viewport.
<br><br>I've had some major problems trying to figure out where to best implement this functionality. Currently, I've rigged  a renderwindow to add an extra overlay after rendering it's contents, and  I've set up an interactor style to      capture the mouse movements.
<br><br>However, I cannot make up my mind in which coordinate system I should  store the brushed points.  I would like my overlays to be invariant to renderwindow size changes. Therefor all coordinate systems that have the aspect ratio included in them (I mean they are normalized over the whole window) seem to be unusable.
<br>I've looked at VIEW and DISPLAY and their normalized variants, but the type of coordinate system that I think would be best are camera coordinates before the perspective projection.<br><br>However, this type of coordinate system does not seem to be generally available. Going through the documentation and the source code seems to show that there is no real  coordinate transform step between   view and world.  The renderer (in worldtoview and such) seems to directly use the camera's GetCompositePerspectiveTransformMatrix, while what I'd need would be GetPerspectiveTransformMatrix.
<br><br>I can make this transform myself by inverting the perspectiveTransformMatrix, but this involves knowing the 'GetTileAspect()' of the renderer and the near and far clipping plane, which seems to me a bit too 'internal' and a bit of a kludge.
<br><br>Could you recommend an other solution to this or tell me whether I'm on the right track here?<br><br>ps. i've considered storing everything just in unprojected world coordinates, which would make the rendering a lot easier, but then  I also have to keep track of the near clipping plane, and I'd prefer to just  store two-dimensional points instead of three.
<br>