未验证 提交 fa5bcf0f 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #16151 from linbingquan/clean-up

Editor: Remove space character
......@@ -2,74 +2,74 @@
* @author mrdoob / http://mrdoob.com/
*/
THREE.HTMLGroup = function ( dom ) {
THREE.HTMLGroup = function ( dom ) {
THREE.Group.call( this );
THREE.Group.call( this );
this.type = 'HTMLGroup';
this.type = 'HTMLGroup';
/*
dom.addEventListener( 'mousemove', function ( event ) {
/*
dom.addEventListener( 'mousemove', function ( event ) {
console.log( 'mousemove' );
console.log( 'mousemove' );
} );
} );
dom.addEventListener( 'click', function ( event ) {
dom.addEventListener( 'click', function ( event ) {
console.log( 'click' );
console.log( 'click' );
} );
*/
} );
*/
};
};
THREE.HTMLGroup.prototype = Object.assign( Object.create( THREE.Group.prototype ), {
THREE.HTMLGroup.prototype = Object.assign( Object.create( THREE.Group.prototype ), {
constructor: THREE.HTMLGroup
constructor: THREE.HTMLGroup
} );
} );
THREE.HTMLMesh = function ( dom ) {
THREE.HTMLMesh = function ( dom ) {
var texture = new THREE.HTMLTexture( dom );
var texture = new THREE.HTMLTexture( dom );
var geometry = new THREE.PlaneBufferGeometry( texture.image.width * 0.05, texture.image.height * 0.05 );
var material = new THREE.MeshBasicMaterial( { map: texture } );
var geometry = new THREE.PlaneBufferGeometry( texture.image.width * 0.05, texture.image.height * 0.05 );
var material = new THREE.MeshBasicMaterial( { map: texture } );
THREE.Mesh.call( this, geometry, material );
THREE.Mesh.call( this, geometry, material );
this.type = 'HTMLMesh';
this.type = 'HTMLMesh';
};
};
THREE.HTMLMesh.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
THREE.HTMLMesh.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
constructor: THREE.HTMLMesh
constructor: THREE.HTMLMesh
} );
} );
THREE.HTMLTexture = function ( dom ) {
THREE.HTMLTexture = function ( dom ) {
THREE.CanvasTexture.call( this, html2canvas( dom ) );
THREE.CanvasTexture.call( this, html2canvas( dom ) );
this.dom = dom;
this.dom = dom;
this.anisotropy = 16;
this.anisotropy = 16;
};
};
THREE.HTMLTexture.prototype = Object.assign( Object.create( THREE.CanvasTexture.prototype ), {
THREE.HTMLTexture.prototype = Object.assign( Object.create( THREE.CanvasTexture.prototype ), {
constructor: THREE.HTMLTexture,
constructor: THREE.HTMLTexture,
update: function () {
update: function () {
console.log( 'yo!', this, this.dom );
console.log( 'yo!', this, this.dom );
this.image = html2canvas( this.dom );
this.needsUpdate = true;
this.image = html2canvas( this.dom );
this.needsUpdate = true;
}
}
} );
} );
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册