-
-
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
Should setCamera() also call resetMatrix()? #7056
Comments
@davepagurek would this approach also affect/reset transformations applied elsewhere in code? |
I think it would only affect transforms if you're calling |
As long as the reference is clear about where/when to call |
Right, I guess the rule would be, set the camera before you draw the content? Also, we have this PR basically ready to start testing as soon as we're done making quick docs releases for the website release: #6761 I think after this change, since the camera and model transform matrices will not be merged into a single variable, we actually might not need to reset at all, since we'll be able to discern what part came from transforms vs what part came from the camera. So maybe the thing to do is to wait until we can merge and test to see if that refactor fixes this for us? (The reason for the wait is that it's a pretty big change to a core part of the rendering algorithm, which I think warrants a beta testing period before release, which we've been skipping for our expedited docs releases.) |
Agreed that beta testing for this kind of change is a good call. |
Most appropriate sub-area of p5.js?
p5.js version
1.9.3
Web browser and version
All
Operating system
All
Steps to reproduce this
Currently, setting a camera just updates the projection matrix and does not change the model view matrix. I assume that normally this is not an issue because people don't switch cameras in the middle of
draw
. However, this leads to some confusion when using cameras on framebuffers, which must be applied withindraw
. If you comment out theresetMatrix
call, changing cameras has no effect:Live: https://editor.p5js.org/davepagurek/sketches/8uENBvPU3
I think
setCamera
should also updateuMVMatrix
, basically also updating the camera position.The text was updated successfully, but these errors were encountered: