AR-js-org / AR.js

Image tracking, Location Based AR, Marker tracking. All on the Web.
MIT License
5.46k stars 930 forks source link

marker axis orientations (vertical/horizontal marker switch) #200

Open taime opened 3 years ago

taime commented 3 years ago

Do you want to request a feature or report a bug? feature

What is the current behavior? The marker should be on a flour

If the current behavior is a bug, please provide the steps to reproduce.

Please mention other relevant information such as the browser version, Operating System and Device Name

What is the expected behavior? Is there any parameter that would switch marker mode? I mean if I want use marker on a flour (horizontal) or I want to put it on the wall, so it would be vertical..

If this is a feature request, what is motivation or use case for changing the behavior? Sometimes we need to use horizontal marker (on a flour), sometimes we want to use vertical marker (on a computer screen or on the wall)

p.s. I know I can change model orientation, using rotation, but it doesn't work if, for example we would use aframe look-controls

<!DOCTYPE html>
<html>
    <script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
    <!-- we import arjs version without NFT but with marker + location based support -->
    <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
    <body style="margin : 0px; overflow: hidden;">
        <a-scene embedded arjs>
        <a-marker preset="hiro">
            <a-entity
            look-controls
            position="0 -1 0"
            scale="0.05 0.05 0.05"
            gltf-model="https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/scene.gltf"
            ></a-entity>
        </a-marker>
        <a-entity camera></a-entity>
        </a-scene>
    </body>
</html>
oninross commented 3 years ago

@taime add a rotation parameter to the a-entity (eg rotation='0 0 -90')

mr339 commented 2 years ago

any updates on this? i was having the same query but in my case i'm using gesture-handler which behaves very oddly if i fix the orientation of the <a-entity gltf-model ="" ...> with rotation="-90 0 0". This is for image tracking using nft