VideoTexture 视频纹理

—> Texture

VideoTexture 就是把视频流中的图像作为纹理贴在几何体上, 里面的第一个参数为 H5 的 video 标签对象.

function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { } var video = document.createElement('video'); video.crossOrigin = 'anonymous'; video.width = 550; video.heigth = 450; video.src = '---.mp4'; video.play(); var videoTexture = new THREE.VideoTexture( video ); videoTexture.minFilter = THREE.LinearFilter; videoTexture.format = THREE.RGBFormat; var material = new THREE.MeshBasicMaterial( {color:0xffffff, map: videoTexture, side: THREE.DoubleSide })

Attributes

isVideoTexture : Boolean

Default value : true (只读)
Description : 类型是否为VideoTexture.

generateMipmaps : Boolean

Default value : false
Description : 是否为纹理生产 mipmaps.

Methods

update( ) : null

更新, this.needsUpdate 为 true.