-
Notifications
You must be signed in to change notification settings - Fork 15
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
Chaos overhaul #540
base: ui2
Are you sure you want to change the base?
Chaos overhaul #540
Conversation
Ok, this is far enough along to put in a draft PR. There's still a bunch to do, but I think the code is as readable as it gets for me (heavily based on turtle, which helps), and the thing works in WebGL. You can try it out if you're curious. There's one issue I'm unsure how to resolve, which is reproducible in the following way and appears to be something to do with P5GL.
The catch? There's zero lines of code between |
Some to-do items:
|
I attempted to check this issue out for you, but I never observed "Stopping" in my console, so is perhaps something else awry? |
Oh, I see you commented out most of the code in that stopping section, including the console.log of "Stopping". I am observing the lag on the initial drag. But there's a lot of chatter in the console, and the console doesn't seem to be telling me much about where in the code it's freezing up. In particular, sometimes I see a last line of "Starting" while I am waiting for the lockup to end, but other times the last line is "end drawing loop 10001". And if I add a console.log of "Starting1.7" after "1.5", it seems to change the distribution of what I see. So I expect we're seeing variations in async scheduling and execution. So I am really not sure what we're waiting on before that first drag starts... But I don't think it's particularly happening at that spot in the code between Starting and Starting1.5. |
I am not at all sure I have gotten to the bottom of this, but it seems to me that the first time that Chaos needs to execute a I don't think the above observations really explain why Chaos seems much harder on my poor computer than Turtle, though -- and I don't think we do anything in Turtle to avoid all of the chunks being used for the first time on the first drag. Those deficiencies are a big part of why I don't think I've really gotten to the bottom of this whole thing... If you decide to abandon pan, roll, and zoom, I wouldn't cry -- they are regular polygons anyway, so rotating is not too helpful and you can just make the vertices as spread out as possible so the image won't go off the canvas. But having made the switch to WebGL, if you want to keep it that way I am OK with it, too. |
I was glad to see that it Just Worked to take the sierpinski triangle gallery specimen and set the step formula to 1.5 -- produces a very nice picture. Not certain whether or not steps over 1 worked before. |
Along those lines, this makes a pretty picture: http://localhost:5173/?name=Chaos+Game&viz=Chaos&corners=3&stepFormula=max%281.7-.0001n%2C+0.5%29&seq=Random&max=2&last=13999&length=14000 The length here is chosen so that it doesn't run too long with the "standard" step value of 0.5. |
I think in light of #541 we should just move ahead with this for alpha with an "all-formula" interface, and then after alpha, split it into its operational "pre-visualizer" and a skin that restores some of the options that have been blown away (but which behavior can be reproduced with the proper formulas), like the different coloring schemes. Question: do we need to document what options we want to restore other than via looking at the git history? |
By submitting this PR, I am indicating to the Numberscope maintainers that I have read and understood the contributing guidelines and that this PR follows those guidelines to the best of my knowledge. I have also read the pull request checklist and followed the instructions therein.
This should eventually resolve #518 #447 #384 #317 #539
Still to do: