-
Notifications
You must be signed in to change notification settings - Fork 6
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
Light view should return to black. #258
Comments
This has also bugged me @samreid, but I didn't realize the Java version reset the lattice to black. |
The pulse rendering in Java looks like this, and the wave disappears before it reaches the right hand side of the lattice: Is this acceptable? Should I pursue a similar algorithm as in Java? An alternative would be to use a heuristic to determine when the time average of the wave in a cell had gone below a threshold, then to turn it to black. Either way, I think we will see artifacts. @ariel-phet marked this as "priority:2-high", so I'm presuming this must be addressed before 1.0, is that correct? |
@samreid yes, I think this issue must be addressed in a reasonable way before 1.0 is published. The ending before the right side of the lattice should be avoided if possible. I think I would see how the clearing of the continuous wave is done, and follow that approach if possible. Some artifacts will be acceptable, it just depends on the level of severity. |
That looks pretty bad to me, but I agree with @ariel-phet. Let's address the continuous wave first.
The Java algorithm seems like a reasonable place to start to me @samreid. I think the other approach could get messy. What about a low-amplitude wave far from the source? We would need a reasonable threshold that didn't allow any cells to turn black unless the source was truly off. |
Note that in the "Slits" screen, when the wave is turned off, the light wave is instantly cleared everywhere. This has the desired effect of changing the wave area to black. Can we use this strategy for clearing the light scene on the first two screens? It sounds like the implementation would be straightforward, probably less than an hour. A strategy like the one in the Java implementation would take significantly longer to implement, lead to more complex code to maintain and would exhibit odd corner case behavior like #258 (comment) and #258 (comment) I'll hold off working on this issue until hearing from @arouinfar and @ariel-phet. |
@samreid That might be a fine strategy for turning off the "continuous light". (In fact, I am totally on board with that strategy if the laser is button is turn in continuous mode on the waves screen). I am not sure what you would do on the interference screen since the buttons can be turned off independently? This strategy also does not seem to fix the problem of waves on in "pulse" mode on the waves screen. (as in, how do I send out a single pulse that does not leave a "trail" of light) |
Once we solve this issue for light, it may be possible to leverage the same strategy to clear out trailing ripples for sound and water, which would address #251. Not 100% sure that will need to be done, but making a comment here in case it is helpful to keep that in mind. |
Here's a patch that looks like this: It uses the strategy from Java to propagate a parallel lattice of "dark" values and can also be used to signify shutoff values. However, there is a problem where the main wave leaks back into the shutoff wave.
```
Index: js/common/model/Lattice.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- js/common/model/Lattice.js (revision 1c52708)
+++ js/common/model/Lattice.js (date 1546646534000)
@@ -186,6 +186,10 @@
this.matrices[ ( this.currentMatrixIndex + 1 ) % this.matrices.length ].set( i, j, value );
}
Index: js/common/model/Scene.js
|
I think I understand the Java model better--it is creating a new lattice each time you shut off a wave. Then in has a heuristic for what constitutes a wave front, and uses that to erase values in the view only (not in the model). Another heuristic determines when to delete the new lattices. |
I made some improvements--support for pulse, and clear out the shutoff wave. Still has significant problems though. I'll push to a branch just in case. |
The strategy proposed in #300 is working nicely, I'll promote it to master. |
On hold until I figure out #302, which may be related. |
I have a workaround in place for #302, and I published https://phet-dev.colorado.edu/html/wave-interference/1.0.0-dev.57/phet/wave-interference_en_phet.html which clears the residual wave artifacts after turning off the source (whether continuous or pulse). It also significantly cleans up the graph when the wave is off. @arouinfar can you please take it for a test drive and let me know if you see any problems with it? |
In design meeting, this seemed good, closing. |
In #251 (comment) @ariel-phet said:
The text was updated successfully, but these errors were encountered: