phetsims / pendulum-lab

"Pendulum Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 10 forks source link

String detaches from the angle marker #154

Closed phet-steele closed 7 years ago

phet-steele commented 8 years ago

The string detaches from the angle marker at angles higher than ~20 degrees. At low angles the string is close to the middle of the angle marker (left picture), but at higher angles it isn't (right picture):

screen shot 2016-06-30 at 3 01 45 pm

This causes the period trace at high angles to be inaccurate. The trace makes it appear that the pendulum has gone farther than its starting point:

screen shot 2016-06-30 at 3 33 09 pm

Seen on OSX 10.11.5 Chrome and iOS 9.3.2. For phetsims/tasks/issues/632 Troubleshooting information: Name: ‪Pendulum Lab‬ URL: http://www.colorado.edu/physics/phet/dev/html/pendulum-lab/1.0.0-dev.11/pendulum-lab_en.html Version: 1.0.0-dev.11 2016-06-29 18:50:32 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 Language: en-US Window: 1920x1002 Pixel Ratio: 2/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 32 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 16) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"7d27130a","branch":"master"},"axon":{"sha":"83211f20","branch":"master"},"babel":{"sha":"0ce3b9c8","branch":"master"},"brand":{"sha":"f0b1f7da","branch":"master"},"chipper":{"sha":"8b0e56b0","branch":"master"},"dot":{"sha":"8782eeac","branch":"master"},"joist":{"sha":"fa5db70c","branch":"master"},"kite":{"sha":"dce9765e","branch":"master"},"pendulum-lab":{"sha":"9521f5f5","branch":"master"},"phet-core":{"sha":"c48bf320","branch":"master"},"phetcommon":{"sha":"35ef94ad","branch":"master"},"scenery":{"sha":"4476eb95","branch":"master"},"scenery-phet":{"sha":"6de9c366","branch":"master"},"sherpa":{"sha":"77506dc3","branch":"master"},"sun":{"sha":"0d7e743b","branch":"master"},"tandem":{"sha":"b3c68afa","branch":"master"}}

veillette commented 8 years ago

The reason for the misalignment was that the top of the protractor is not the the protractor itslef but a circle around the middle of the protractor. This was taken into account by manually raising the protractor by the radius of the circle. The thing that was missing was the linewidth of the stroke of the circle.

We could have added it up to fix up the misalignment and that would be the end of it.

Instead we decided to use a modelViewTransform and align the protractor and the pendulum in the model instead. This is a pretty significant touch up.

It may have some performance implications though. We may need to do some regression testing.

jonathanolson commented 7 years ago

This looks fixed, will check performance later in the process (during the code review)