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

Canvas Zooming And Panning #437

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Canvas Zooming And Panning #437

wants to merge 5 commits into from

Conversation

Forchapeatl
Copy link
Collaborator

@Forchapeatl Forchapeatl commented Jul 22, 2022

Test Case: Implementation of Canvas Zooming and Panning

found at https://stephaniequintana.github.io/infragram/index3.html

6a2bfb7c-c820-41fc-bf73-7812fae0029f.mp4

TODO

  • Panning User experience
  • Add resolution change to webcam
  • zoom by + and - buttons

Fixes #418

Hello @jywarren @cesswairimu @TildaDares @stephaniequintana .
Another milestone has been achieved. The zooming works fine but the panning experience is horrible. I can't seem to understand the flow of moue events. Please does any one know of a website where ,panning of Webgl canvas has been implemented ? I need to get a feel of the panning experience so that ours(infragram) can be improved. Here is a link to the current implementation at https://stephaniequintana.github.io/infragram/index3.html . Thank you. Please I am also relying on your feed backs for improvements.

Thank you!

@gitpod-io
Copy link

gitpod-io bot commented Jul 22, 2022

@Forchapeatl Forchapeatl changed the title Update webgl.js Canvas Zooming And Panning Jul 22, 2022

void main(void)
{
gl_Position = vec4(aVertexPosition, 0.0, 1.0);

gl_Position = vec4((aVertexPosition * uScale) + uTranslation, 0.0, 1.0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is a tough one! The translation within webGL is mathematically tough!

What about... would it work to do the panning outside of the image processing flow -- like, after it's been rendered, could we pan around a really large HTML element? Would that be easier? Could we use something like this library to do that? (it uses CSS i believe?)

https://cmorillas.github.io/panzoom/

What do you think? Can you tell us a bit more about what the issues are that you're trying to solve in the panning? What specifically makes you feel it's not working well, or what do you imagine it to be if it were working well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jywarren. Attributing mouse coordinates to the WebGL texture was a headache. The https://cmorillas.github.io/panzoom/ is a life saver. Thank you!

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.

GSoC Infragram.org full-screen UI and video upload Discussion and Planning
2 participants