experimental icon indicating copy to clipboard operation
experimental copied to clipboard

Make line_agg_collec work with document transform and latest vispy ModularProgram

Open campagnola opened this issue 11 years ago • 2 comments

@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).

campagnola avatar Jul 10 '14 03:07 campagnola

Note: this depends on another PR: https://github.com/vispy/vispy/pull/315 You can pull the source branch if you want to try these changes before that PR is merged.

campagnola avatar Jul 10 '14 04:07 campagnola

Thanks Luke, looks great! I'll try that soon.

rossant avatar Jul 10 '14 09:07 rossant