Skip to content
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

Direction of reflected visible light changes #87

Closed
Nancy-Salpepi opened this issue Sep 17, 2021 · 4 comments
Closed

Direction of reflected visible light changes #87

Nancy-Salpepi opened this issue Sep 17, 2021 · 4 comments
Assignees
Labels
type:bug Something isn't working

Comments

@Nancy-Salpepi
Copy link

Test device
MacBook Air (m1 chip)

Operating System
11.5.2

Browser
seen in both chrome and safari

Problem description
phetsims/qa#707

The direction of the reflected visible light changes depending on when the cloud is first introduced into the sim. If introduced when the sim is in Date Mode, the reflected light veers to the right. It will always move in that direction regardless of the setting until the sim is reset. If the cloud is introduced when the sim is in Slider Mode, the reflected light veers to the left and is partially obstructed by the Energy Balance Panel.

Steps to reproduce

  1. Press the "Start Sunlight" button
  2. Check the Cloud checkbox (reflected light moves to upper left)
  3. Select Date mode
  4. Uncheck the Cloud checkbox
  5. Wait for the reflected wave to disappear and then recheck the Cloud checkbox
  6. Reset sim
  7. Repeat above steps starting in Date mode and moving to Slider mode (reflected light moves to upper right)

Visuals
Cloud first introduced in Slider Mode:

Screen Shot 2021-09-17 at 8 00 53 AM

Cloud first introduced in Date Mode:

Screen Shot 2021-09-17 at 8 00 21 AM

Troubleshooting information:
!!!!! DO NOT EDIT !!!!!
Name: ‪Greenhouse Effect‬
URL: https://phet-dev.colorado.edu/html/greenhouse-effect/1.0.0-rc.1/phet/greenhouse-effect_all_phet.html
Version: 1.0.0-rc.1 2021-09-14 17:56:28 UTC
Features missing: touch
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15
Language: en-us
Window: 1199x683
Pixel Ratio: 2/1
WebGL: WebGL 1.0
GLSL: WebGL GLSL ES 1.0 (1.0)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 31 uniform: 1024
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 8192x8192
OES_texture_float: true
Dependencies JSON: {}

@Nancy-Salpepi Nancy-Salpepi added the type:bug Something isn't working label Sep 17, 2021
@arouinfar
Copy link
Contributor

Thanks for reporting @Nancy-Salpepi.

I think what's happening is that there are two possible sets of waves. With waveGapsEnabled=true you will see the sim cycle between each set. The default sim behavior is now waveGapsEnabled=false, but I think the default set of waves is randomly chosen. If the incoming sunlight is on the left side of the cloud, the reflected wave will go to the left. However, if the incoming sunlight is more towards the right side of the cloud, the reflected wave will go to the right.

I'll let @jbphet confirm if my suspicion is correct. If so, I'll make a note in the Teacher Tips and we can close.

@jessegreenberg this does not block the prototype version.

@jessegreenberg
Copy link
Contributor

I just took a look at the code and what you described matches what I see @arouinfar. This code specifically changes the direction of the wave depending on whether it is to the left or the right of the position of the cloud

const direction = incidentWave.origin.x > cloud.position.x ?
GreenhouseEffectConstants.STRAIGHT_UP_NORMALIZED_VECTOR.rotated( -Math.PI * 0.1 ) :
GreenhouseEffectConstants.STRAIGHT_UP_NORMALIZED_VECTOR.rotated( Math.PI * 0.1 );

@jbphet
Copy link
Contributor

jbphet commented Sep 27, 2021

The two comments above are correct. @arouinfar - This can easily be changed such that we use a consistent set of initial waves at the outset. I just didn't think about it when adding the ability to turn off wave gaps. Would it be an improvement to do so? If so, please assign back to me and I'll take care of it, otherwise please close.

@jbphet jbphet assigned arouinfar and unassigned jbphet Sep 27, 2021
@jbphet
Copy link
Contributor

jbphet commented Sep 29, 2021

We discussed this in today's design meeting, and decided to leave the current behavior as is, at least for now. Closing.

@jbphet jbphet closed this as completed Sep 29, 2021
@arouinfar arouinfar mentioned this issue Sep 29, 2021
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants