vispy/experimental — pull request #2 by lcampagn (2014-07-10 03:59:54+00:00)
Title: Make line_agg_collec work with document transform and latest vispy ModularProgram

@Cyrille: This modifies your agg line visual to use a document transform. To demonstrate the flexibility of this, I tossed in a polar transform.

The transforms look like this:
* `transform` maps from the data coordinates to the _document_ coordinates, which I have defined as canvas pixels with 0,0 in the upper left. This transform is defined entirely using the panzoom, but this is not strictly necessary. The document coordinate system is where line widths are defined, and thus where they must be applied.
* `doc_px_transform` would describe the difference between logical and physical pixels, but for us there will be no difference so it is an empty transform for now. We'll eventually need to test this on a high-res display..
* `px_ndc_transform` maps the rest of the way to NDC, and thus appears at the very end of the vertex shader. Both `doc_px` and `px_ndc` are defined by your Canvas subclass; eventually these should appear in the base Canvas class instead.

There are probably still a few issues--I have not tested dashing, for example. I think for dashing to work correctly, it will be necessary to do the initial mapping to document coords on the CPU (because we can't measure distance along the path on the GPU).