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

Create ‹three-app› basic container and view #2

Open
9 tasks
olange opened this issue Feb 20, 2019 · 1 comment
Open
9 tasks

Create ‹three-app› basic container and view #2

olange opened this issue Feb 20, 2019 · 1 comment
Assignees

Comments

@olange
Copy link
Collaborator

olange commented Feb 20, 2019

Features

  • Import THREE.js and makes it available in Window global scope — actually, a non-desired feature, constrained by the CameraOrbiter (see Create ‹three-camera› OSC controller #7); we really want let the browser handle the imports
  • Handle resizing of its bounding box — propagating the change to the aspect ratio to the cameras and renderer (use Resize Observer API)
  • Animate the scenes and cameras — synchronized in the same animation step, running at a desired FPS (if possible)
  • When canvas not in view, pause rendering – but keep scene and camera animation updates running (may be throttle FPS), to save resources (use Intersection Observer API)
  • Renders the current scene, at the same desired or actual FPS
  • Handle lifecycle, with guarantees about elements initial state – move this to new separate issue
    • Review loading of Web Components Polyfills definition of components, have them deferred
    • Deferred mutual registration of ‹three-app/-scene/-camera› (use Mutation Observer API and/or customElements.whenDefined() and/or querySelectorAll(':not(:defined)'))
    • Trigger initialization of animation, once all elements are ready and know of each other

See also

@olange olange self-assigned this Feb 20, 2019
@olange olange changed the title Create ‹three-app› basic app container Create ‹three-app› basic container and view Feb 20, 2019
@olange
Copy link
Collaborator Author

olange commented Mar 21, 2019

Some sort of guarantee on custom element lifecycle order of events
WICG/webcomponents#737:

customElements.whenDefined()

class ElementOne extends HTMLElement {
    async connectedCallback() {
        await customElements.whenDefined(ElementTwo.localName)
    }
}

or use Mutation Observer API.

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

No branches or pull requests

1 participant