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

Revise the implementation of model-view transforms. #277

Closed
pixelzoom opened this issue Dec 14, 2021 · 4 comments
Closed

Revise the implementation of model-view transforms. #277

pixelzoom opened this issue Dec 14, 2021 · 4 comments
Assignees

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Dec 14, 2021

This sim has some interesting model-view transform requirements, related to the zoom feature:

  • Most things (lens, mirror, object, light source, rays, image, screen,...) are supposed to scale as you zoom in/out.
    *Labels are supposed to translate, but not scale.
  • Rulers change model length so that their view length remains constant.

The above requirements are implemented via 3 different (but related) transforms, all defined in GOScreenView.js:

  • modelViewTransform: ModelViewTransform2
  • zoomTransformProperty: DerivedProperty< ModelViewTransform2 >
  • zoomScaleProperty: DerivedProperty<number>

Having 3 transforms creates a few problem:

I'm fairly certain that the requirements can be met with a single Property<ModelViewTransform2>, and I'll be investigating that.

@pixelzoom
Copy link
Contributor Author

The model-view transform was significantly simplified in the above commit. Tested with ?debugModelBounds to verify that the model bounds are behaving correctly.

@pixelzoom
Copy link
Contributor Author

Reopening. This broken a bunch of things.

@pixelzoom
Copy link
Contributor Author

Status:
#291 and #298 have been fixed.
#299 (rulers jump around) is still a problem.

@pixelzoom
Copy link
Contributor Author

#299 was broken before these changes, as demonstrated in 1.1.0-dev.14. So closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant