We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

canvas replace texture

Home Forums Puzzles canvas replace texture

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #56565
    barman126
    Participant

    picture as texture is work but texture is video don’t work

    Attachments:
    You must be logged in to view attached files.
    #56578
    kdv
    Participant

    You should update the canvas texture to see video playing.

    https://v3d.net/bk0

    And you could use a little simpler variant. The final result will be the same.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56599
    barman126
    Participant

    thank you video puzzle i know and it’s easy I’m also interested in canvas but I am a beginner in programming :yes: :yes: :yes:

    #56600
    kdv
    Participant

    Well, it makes sense. The canvas allows to show tiled videos or several videos.
    https://v3d.net/bk0

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56601
    barman126
    Participant

    HAHA——awesome :heart: :heart: :heart:
    Can you share the puzzles :yahoo:

    #56603
    kdv
    Participant
    const ctx = VARS.canvas.getContext("2d");
    const video = document.createElement("video");
    video.src = "media/yellow_fish.mp4";
    const video1 = document.createElement("video");
    video1.src = "media/small_video.mp4";
    
    video.addEventListener('loadeddata', function() {
      video.muted = true;
      video.loop = true;
      video.play(); // start playing
      video1.muted = true;
      video1.loop = true;
      video1.play(); // start playing
      update(); // start rendering
    });
    
    function update() {
      ctx.drawImage(video, 0, 0, 320, 180);
      ctx.drawImage(video1, 320, 0, 320, 180);
      ctx.drawImage(video1, 0, 180, 320, 180);
      ctx.drawImage(video, 320, 180, 320, 180);
      v3d.puzzles.canvasTextures.myCanvas.needsUpdate = true;
      requestAnimationFrame(update);
    }

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56604
    barman126
    Participant

    I’m learning this project on mywebar.com
    1.I Know canvas replace texture
    2.video need Filter green
    3.AR

    I’m very interested in these

    Attachments:
    You must be logged in to view attached files.
    #56606
    barman126
    Participant

    OK thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.