networked-aframe / naf-valid-avatars

Example of using realistic animated avatars in networked-aframe.
https://naf-valid-avatars.glitch.me
MIT License
10 stars 0 forks source link

Add an example of loading another scene and stay connected #16

Closed vincentfretin closed 6 months ago

vincentfretin commented 6 months ago

I developed a change-room component that loads another scene by fetching the html, selecting a specific entity and replacing another entity on the current page and changing the easyrtc room. Add an example in this repo.

vincentfretin commented 6 months ago

I previously did this with htmx, it actually works great! But this doesn't handle changing the room id, so I created a new component for this. But if you want to load a part of a scene when you click on some 3d button, that may be a nice way to do it. Here is a snippet changing a scene when you click on a portal:

<script src="https://unpkg.com/htmx.org@1.9.10"></script>
...
<a-entity
  id="scene"
  environment="preset:forest;shadow:true"
>
  <a-link
    hx-trigger="click once"
    hx-get="japan.html"
    hx-select="#scene"
    hx-target="#scene"
    hx-swap="outerHTML"
    link="on:dontcare"
    href="japan"
    position="-3.5 1.5 -1.0"
    image="#thumbJapan"
  ></a-link>
</a-entity>