-
Notifications
You must be signed in to change notification settings - Fork 166
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
base: main
Are you sure you want to change the base?
Conversation
|
||
void main(void) | ||
{ | ||
gl_Position = vec4(aVertexPosition, 0.0, 1.0); | ||
|
||
gl_Position = vec4((aVertexPosition * uScale) + uTranslation, 0.0, 1.0); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
Test Case: Implementation of Canvas Zooming and Panning
found at https://stephaniequintana.github.io/infragram/index3.html
6a2bfb7c-c820-41fc-bf73-7812fae0029f.mp4
TODO
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!