How can we have display of same objects in two canvas in webgl?

后端 未结 2 831
难免孤独
难免孤独 2020-12-07 04:33

I am under a situation that i have two canvas, and i want to display the same object in both canvas (in fact i have to display different objects in each canvas, but i want t

2条回答
  •  一整个雨季
    2020-12-07 04:55

     var canvas = document.getElementById("canvas"),
         canvas2 = document.getElementById("canvas2");
     gl = canvas.getContext("experimental-webgl");
     gl2 = canvas.getContext("experimental-webgl");
    

    I think you missed the reference to the second canvas element

提交回复
热议问题