ryota-mitarai / aframe-websurfaces

📦 An aframe component for adding interactable webpages to your scene.
https://www.npmjs.com/package/aframe-websurfaces
MIT License
16 stars 10 forks source link

Websurface positioning in nested entities #3

Open calvincs opened 2 years ago

calvincs commented 2 years ago

When constructing en entity like so, the websurface component does not align to the parent entity. If you translate the parent, the children object translate, but the websurface does not.


   <a-entity
        position="-3.5 0 0"
        rotation="0 90 0"
        scale="1.75 1.75 1.75" 
        gltf-model="/objects/example.glb"
        material="color: #ffffff; metalness: 1; roughness: 0.05;"
        >
            <a-image 
                src="/objects/image.jpg" 
                position="0 1.1 0" 
                rotation="0 0 0" 
                scale="0.66 0.5 0.5"
                >
            </a-image>
            <a-entity  
                class="clickable" 
                websurface="url: example.site.com" 
                position="0 0.6 0" 
                rotation="-14 0 0" 
                geometry="primitive: plane; width: 2" 
                scale="0.35 0.52 0.46"
                >
            </a-entity>
    </a-entity>

Tested with Aframe 1.2.0

calvincs commented 2 years ago

Work around solution, make the websurface the primary entity and nest your components inside of it instead. This works, but would be great to not have to do this.