-
Notifications
You must be signed in to change notification settings - Fork 5
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
Optical axis should look like it's passing through things. #283
Comments
The commit above uses 2 copies of OpticalAxisNode. One is in the far background, the other is in front of the object, image, and projection screen. The one in front uses a This approach handles the object, real image, and projection screen. But it has these known problem:
So I'm going to have to rethink this... |
Here are some screenshots showing how the optical axis passes through the object, real image, and projection screen respectively. Note that the real image is transparent, so you can see the axis through it. Based on previous design discussions, I'm not sure that this was anticipated, so @arouinfar @kathy-phet FYI. |
@arouinfar How do you want the F and 2F points to behave in situations where they are located at a position on the axis that is occluded by the object, image, or projection screen? Example cases are shown below. Dynamically adjusting the rendering order for the points (so that they are occluded by the object, image, projection screen) is possible, but not easy, might be distracting, and it could be confusing if these points disappear. And I definitely don't want to be trying to show a partial point, for example as the point passes "through" the object. I need a reply with high priority, because this affects whether I continue with the current approach, or have to switch to something else. |
Notes from Zoom meeting with @arouinfar:
|
In the above commit, I added support for virtual image. This requires a
Next up is adding the mask to make the optical axis appear more "faint" where it's occluded by the image. |
The remaining bit of work here from #283 (comment) is:
The most straightforward way to create the mask would be to use scenery.Image |
In the above commit, I'm using Image |
@arouinfar This can be reviewed before phetsims/scenery#1333 is resolved. Just keep in mind that the image mask is currently a rectangle, not the shape of the picture frame. The current opacity of the image mask is 0.8. Let me know if you'd like to see more or less of the occluded optical axis. Note that this opacity will also affect how much of the occluded rays are seen. |
Thanks @pixelzoom. The optical axis looks good in the screenshots (thanks for showcasing all of the permutations!) and in master. Things can sometimes look a little strange when the object and image are close to one other, such as in this case: Steps to reproduce:
I think this is an acceptable edge case, but I wanted to bring it to your attention in case there's something else going on with the clipping regions. |
The problem demonstrated in the scenario shown in #283 (comment) is that the implementation is using the nominal width of the framed Image to compute the clipArea. It needs to use scale width of the framed Image. There's a TODO related to this in const halfFrameWidth = 34; //TODO get this from sourceObject.boundsProperty, or from sourceObjectNode I'll work on correcting that. |
The scenario in #283 (comment) has been fixed, see screenshot below. Any remaining weirdness should be related to phetsims/scenery#1333, so I'll leave this open until that issue is fixed. Labeling as on-hold. |
In the above commit, I've added a workaround for the bug in phetsims/scenery#1333. I'm explicitly creating shapes that match the "framed object" images. Tracking removal of that workaround in #296. @arouinfar please review in master. If it looks OK, assign back to me. |
Looks good in master, back to you @pixelzoom. |
#296 tracks remaining work, so closing this issue. |
For posterity... At 1/20/22 design meeting, @ariel-phet asked about an approach where the optical axis is drawn in foreground/background segments. I initially went down that path, then discovered that the dashed pattern of the line would move around. So as you dragged the Object, the axis appeared to scroll. I could have tried resolving that using |
…ramed objects vs light sources, #283
For the record... After "scenes" were introduced in #217, it became possible to use a different approach when the selected object is a light source. Instead of using clipArea, a foreground copy of the optical axis is drawn from the left edge of the screen to its intersection with the projection screen. Because the left edge is the same as the background optical axis, there's no movement of the dash pattern. This implementation has better performance, and appears in 397a6e1. |
Factored out of #125, because the optical axis is a separate project.
We want it to look like the optical image passes through the object, image, and projection screen. So it should be partially occluded by opaque things that are in front of it.
Here's am old mockup, from #125 (comment), showing the optical axis passing through the (old) projection screen:
And in #125 (comment), I said:
The text was updated successfully, but these errors were encountered: