-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Default camera view changed in v1.9? #6694
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you! |
This was an intentional change which is hopefully minor for new sketches. The change was to move from a fixed field of view, which requires the camera position to change when the canvas size changed, to a variable field of view, which left the camera position in place. There are some instructions here on how to call perspective() with a fixed field of view again: https://p5js.org/reference/#/p5/perspective Everything at z=0 should look the same as before though! |
@iadarshrawat We're talking about how it looks, not whether it works. If you don't understand what's being discussed, don't participate in the discussion. |
Simply put, the default value of eyeZ is now 800. As a result, the appearance changes when sketching a small canvas. If you specify camera settings concretely, the problem will not occur, so that is the only countermeasure you can take now. As you can see from #6611, many examples of reference page were broken. I have modified most of them accordingly using the method I just described. |
Hi guys, thank you for the clarification! |
I don't care about the example order as it is a trivial matter.
In #6620, I added descriptions to clarify that eyeZ is 800 in several places in the camera reference. If this is not enough, I will consider adding more, but please carefully review the content first. But the problem is, they won't know that unless they look at the reference page. They may not even realize that it's because the camera's default settings have changed. Since changing the camera defaults is obviously a destructive specification change, I personally think it would be good if such contents were notified in an appropriate manner when updating the version. That will be a challenge for the future. It is also important that the person making the change has this awareness. I think the problem is that it was missing this time, personally. If you're on Twitter, you can also tweet to spread the word that the camera default has been changed. It would be also a good idea to have it brought up in a p5 study session (p5勉強会). |
This change is presented as a fix. But it changed the way how all previous p5 WebGL sketches work. But I am unsure about adding:
...to fix the camera example #6620. It makes the example work but also sends the wrong message that using the camera requires setting the perspective, too. I prefer to keep it simple. I don't remember how the example looked before, but something like this:
...is enough to make it work again. As soon as someone fixes the strokeWeight too (but you know that already). Cheers :-) |
You can see the original example by going to the reference page now.
Unfortunately, with the current specifications, it is not enough to change just the camera to get intended behavior. Because just setting the camera doesn't change the fov. In the previous spec, fov was always fixed at PI/3, but in the current spec, eyeZ is 800, so it is set accordingly. What happens then is that the smaller the canvas, the smaller the fov. This resulted in the appearance of some reference example being unnecessarily enlarged. Specifically, things like debugMode. The expression "wrong message" is wrong. With the current specs, if you only change the camera, you will fall into the fov trap. This was not the case before. This is because most people set their camera settings depending on the canvas size. However, that is now a thing of the past. The only way to avoid this is to establish the use of perspective() as the new standard. To convey this, I've modified the example accordingly. Using perspective() is no longer unavoidable. It is true that it is inconvenient. But there's nothing I can do. Frankly, I hate this change. I think it is extremely unnatural to have to revise so many examples. All we can do now is better understand camera specs than ever before. p5.js webgl is no longer suitable for beginners. |
camera(0, 0, 300 + sin(frameCount * 0.03) * 200, 0, 0, 0, 0, 1, 0);
Which example is this about? I won't know unless you post the link. It's that easy, right? I can't debate, so I can't comment for this. |
I also tried to spread the word by tweeting. However, the people who responded only gave fav. He won't RT. In other words, it wouldn't spread, so it was no good. It's no good unless someone with a lot of followers who RT does it. |
Yup. That is the new reality. |
It's not a big problem, and this specification won't change in the future, so I think you can close this issue now. |
Is this just for when you use a custom camera? Examples like the one for
For this case, a possible simple change is just to change the camera position in the existing call: I think the perspective call also works here, if that helps keep our examples working. But I don't think it's necessary that users need custom perspective when just changing the camera location. That's the main reason why for now we're sticking with the change. Probably the main case where you might want to edit the FOV is when you have a specific scene that you want to fill the frame, and where you aren't already adapting the scene to the frame size. I could see it being useful to add a camera function that takes in just a field of view, and it grabs the current aspect ratio for you. (This would avoid also moving the camera closer to/farther from the subject when the aspect ratio changes, leaving the camera position to you to manually change. The automatic distance changing was the cause of #6203 originally and the need to shake things up, for context.) Would that help with some of your concerns? |
Well , i agree to this. Since, the default settings should be designed to work well for a broad range of users and scenarios, providing an intuitive and user-friendly experience for most cases, it recognizes that users may have diverse needs and preferences, and a one-size-fits-all approach might not be ideal. |
@davepagurek |
@Garima3110 If you didn't need orbitControl(), you might have had the option of eliminating that line from that code. |
I'm mostly interested in seeing what we can do to improve the situation going forward, in two areas. The main one is your sense that p5.js webgl is no longer suitable for beginners. This is something we care a lot about so I want to make sure concerns are addressed. I was trying to get a sense of whether that was just because the versions of some functions with no parameters broke in 1.9.0 (understandably making things harder, but also will be fixed again in the next release) or if there was something more fundamental that needs to be changed that we haven't addressed yet in the fixes that will be released soon. Let me know if there are scenarios like that! The other area is in prevention of regressions. I don't like to blame individual contributors for not having remembered to check everything--as a reviewer, I certainly don't always remember everything, so I'd prefer to instead look at systems we can improve to help prevent those issues in the future. So far, we're trying to add visual tests to better notice regressions, and we're creating beta builds to help us find issues before they go out to users. I hope these processes can grow and make it easier to make changes confidently. If anyone has more suggestions, feel free to let us know! |
@komatebe |
The people who are disadvantaged by inappropriate reference examples are the people who need those reference examples. |
In other words, the person who needs the reference example should decide how to properly edit the reference example. There is no meaning in arbitrarily determining it by ours. That'll just end up with nonsence results anyway. |
There was an omission in fixing reference example. I think it's better to deal with it. |
Was it needed to include |
Please also refer to #6611. The cause is #6216. I'm irrelevant. |
Okay thanks I will. :) |
I noticed this change over the weekend while tinkering with another project. To echo @komatebe's point about the need for reprogramming, the ray casting example is now broken. Most of the other examples on the p5.js website seem fine except for orbit control. It's not immediately clear to me that the camera change is unfriendly to beginners–just different. As a quick test, does anybody have a fix for the ray casting example? |
@inaridarkfox4231 I realize I'm pretty late to the discussion, but I wanted to respond to your comment:
It can be hard to maintain empathy with beginners once you've gained a certain level of expertise (see curse of knowledge). Here's part of a discussion with Tega Brain from her book Code as a Creative Medium:
We all started somewhere. Beginners generally don't know what they don't know. It's up to more experienced contributors to create an environment (APIs, docs, etc.) that supports them. If you're not sure how a contribution may impact beginners, ask around. You can also code a few practical examples and imagine explaining them to someone who is encountering the feature for the first time. |
@nickmcintyre I think it works after this small change: - eyeZ = height / 2 / tan((30 * PI) / 180); // The default distance the camera is away from the origin.
+ eyeZ = 800 // The default distance the camera is away from the origin. I'll take a pass later through the examples directory to update that + the orbitControl one, thanks for pointing it out! Edit: PR is up here: https://github.com/processing/p5.js-website/pull/1506 |
Most appropriate sub-area of p5.js?
p5.js version
1.9
Web browser and version
All
Operating System
All
Steps to reproduce this
Has the default camera view in WEBGL mode changed in the latest 1.9 version of p5js?
I have noticed a significant difference, and it seems that any sketches created before version 1.9 would require reprogramming to work correctly.
Steps:
Snippet:
The text was updated successfully, but these errors were encountered: