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

Make custom loaders that give you a Lume tree instead of a Three.js tree #264

Open
3 tasks
trusktr opened this issue May 15, 2023 · 0 comments
Open
3 tasks

Comments

@trusktr
Copy link
Member

trusktr commented May 15, 2023

F.e. after this change, a <lume-gltf-model> element would have a resulting ShadowRoot that has a Lume tree loaded from the GLTF model, instead of a plain Three.js tree.

Then we'd be able to do things like

const gltfEl = document.querySelector('lume-gltf-model')
const el = gltfEl.shadowRoot.querySelector('#some-node')
el.setAttribute('has', el.getAttribute('has') + ' physical-material')
el.color = 'blue'

And then, if we have #263, we can manipulate the elements in a better way not relying specifically on the Three.js nodes (making it easier to abstract the HTML interface from Three, and for example use PlayCanvas).

With a Lume tree loaded into a ShadowRoot, then once we support CSS styling we can also style those elements with CSS features like ::part().

  • gltf loader
  • fbx loader
  • collada loader
@trusktr trusktr changed the title Make custom loaders that give you a Lume tree Make custom loaders that give you a Lume tree instead of a Three.js tree May 15, 2023
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