-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
feature request: would like to see modelX(), modelY() functions that exist in Processing #377
Comments
I thought about this more since your post on the forum... this is sort of difficult because p5.js does not keep track of the current matrix as it is transformed. this tradeoff was made to improve performance, so we could take advantage of built-in transform, scale, etc methods in html5 canvas without having to do a lot of matrix multiplication. you can read more of that discussion here: https://github.com/lmccart/p5.js/issues/243 my suggestion for now would be to manually keep track of the matrix as you transform it. you could also try wrapping some library like this in: but it looks like this one hasn't been updated since 2011 so I don't know. there could be something more recent out there. |
thanks for the suggestion and thoughts. I'm going to temporarily close this as it's not likely doable in the near future with canvas renderer, it would just be too slow. we can reopen and revisit this when we begin work on webgl/3d. |
Is this issue still not doable ? Would love to see these features on p5js |
I keep missing If so, are these limitations specific to canvas/P2D? And so, in WEBGL mode, If " Even with a function like " FWIW! Kinda out of my depth, but happy for any hints or advice! #243 ( |
I like using the matrix functions: translate, rotate, scale. But sometimes I need to know the coordinates of points drawn from the perspective of the main canvas co-ordinate space. So for example if I have a point A that was drawn using a set of matrix transforms and another point B that was drawn using a different set of matrix transforms, I might want to draw a line from point A to point B. To do that I need to have a common co-ordinate space. The functions modelX(), modelY() in the Processing reference do this, it seems, and it would be nice if p5js had these functions as well. See Processing reference: http://processing.org/reference/modelX_.html
The text was updated successfully, but these errors were encountered: