全屏摄像头背景

时间:2017-01-21 20:21:46

标签: background three.js video-streaming

我尝试了this jsfiddle并且无法让背景画布达到窗口的全尺寸。我试过video.width = window.innerWidth但没有运气。可以解释一下吗? T

更新

我认为问题在于这个代码(如果是这种情况,我认为标题应该是&#34;给PlaneGeometry提供window.innerWindth, window.innerHeight&#34; <的维度/ p>

//the geometry on which the movie will be displayed;
//movie image will be scaled to fit these dimensions.
movieGeometry = new THREE.PlaneGeometry( 2,2,0 );
movieScreen = new THREE.Mesh( movieGeometry, movieMaterial );
// movieScreen.position.set(0,50,0);
movieScreen.material.depthTest = false;
movieScreen.material.depthWrite = false

当我更改PlaneGeometry的参数时,将缩放影片图像以适合这些尺寸。问题是我无法找到合适的尺寸。

1 个答案:

答案 0 :(得分:0)

body有保证金 添加:

body {
  margin: 0px;
}

fiddle