Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
296 views
in Technique[技术] by (71.8m points)

Web Ar, Aframe, Ar.js

Thank you, I want to hide the tag before I press the shutter button. My shutter button purpose is to randomize the displayed image. Currently, when I not yet press the shutter button, my img frame is displayed in black frame(i want to hidden this frame). and how can I load the Dance mp4 video right after I scan the bar code? My code is below:

<html>
<body style='margin: 0; overflow: hidden;'>

    <a-scene embedded arjs='sourceType: webcam; debugUIEnabled: false;'>

        <a-assets>
            <video src="Dance.mp4"></video>
            <img id="my-image">

        </a-assets>

        <a-image src="#my-image"
                 position="0 2 -5"
                 width="2.5"
                 height="1.5"
                 scale="1 1 1">
        </a-image>
    </a-scene>

    <div class="ui">
        <a id="take-phot" title="Take Phot"><i class="material-icons">photo_camera</i></a>
    </div>

</body>
<script>
    
    var myPix = new Array("ass/1.png", "ass/2.jpg", "ass/3.png");
    function choosePic() {
        var randomNum = Math.floor(Math.random() * myPix.length);
        document.getElementById("my-image").src = myPix[randomNum];
    }
    var take_photo_btn = document.querySelector('#take-phot');
    take_photo_btn.addEventListener("click", function (e) {
        choosePic();
    });
</script>

</html>
question from:https://stackoverflow.com/questions/65915351/web-ar-aframe-ar-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...