Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make line_agg_collec work with document transform and latest vispy ModularProgram #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

campagnola
Copy link
Member

@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
Copy link
Member Author

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

@rossant
Copy link
Member

rossant commented Jul 10, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants