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

polyfill #63

Open
trusktr opened this issue Nov 29, 2022 · 0 comments
Open

polyfill #63

trusktr opened this issue Nov 29, 2022 · 0 comments

Comments

@trusktr
Copy link

trusktr commented Nov 29, 2022

Is there a polyfill for <model>? Keith Clark's <x-model> is similar.

I'm curious as to whether it would be more worth it for the browsers to have lower-level 3D elements, for example like a-frame, LUME (my fav :D), x3dom, then a GLTF viewing component would be a composition of the lower level elements, much like how a <input>'s ShadowRoot contains <div>s, etc.

<model>
  <#useragent-shadowroot>
    <mesh has="physical-material" ...>
      ...
    </mesh>
    ...
  </#useragent-shadowroot>
</model>

If browsers are going to have standard rendering abilities in order to draw <model> elements, we may as well get the benefit of all the pieces as declarative HTML, so that we can manipulate them with Vue/React/Solid/Svelte/etc, and use the power of CSS, f.e.

<mesh>...</mesh>
<mesh>...</mesh>
<mesh>...</mesh>

<style>
  /* give all three meshes the same style */
  mesh {
    geometry: sphere(20 30 40); /*or something*/
    material-type: phong;
    material-opacity: 0.5;
    material-color: red;
    diffuse-map: url(path/to/texture.jpg);
    bump-map: url(path/to/bumps.jpg);
    /* or similar, etc */
  }

  @keyframes {...} /*animate 3D styles!*/
</style>

Maybe <model> comes first, then eventually we make it have a shadow root once we have the primitives for it, much like how back in the day we could not see the shadow root of an <input> in devtools.

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