Search code examples
youtubethree.jsrender-to-texture

How to use video element or html content as a face texture in three.js?


I am looking to use a video texture for a face in three.js. I know this is fairly easy to do if you have the video data. But what would I do if I only have the element it is playing from?

For example: How would I play a youtube video and copy the video or player onto a face in three.js?


Solution

  • There is an example of integrating Three.js and YouTube videos at

    http://threejs.org/examples/css3d_youtube.html#cats

    and examples of including general HTML elements (using CSS3D) at

    http://learningthreejs.com/blog/2013/04/30/closing-the-gap-between-html-and-webgl/
    and http://stemkoski.github.io/Three.js/CSS3D.html

    Hope this helps!