提交 32414584 编写于 作者: M Mr.doob

Editor: Moved THREE.HTML code out of html2canvas.js

上级 3d66d1e9
......@@ -154,6 +154,7 @@
<!-- <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="qyqgfqd9j8z890t"></script> -->
<script src="js/libs/html2canvas.js"></script>
<script src="js/libs/three.html.js"></script>
<script>
......
......@@ -187,77 +187,3 @@ function html2canvas( element ) {
return canvas;
}
//
THREE.HTMLGroup = function ( dom ) {
THREE.Group.call( this );
this.type = 'HTMLGroup';
/*
dom.addEventListener( 'mousemove', function ( event ) {
console.log( 'mousemove' );
} );
dom.addEventListener( 'click', function ( event ) {
console.log( 'click' );
} );
*/
};
THREE.HTMLGroup.prototype = Object.assign( Object.create( THREE.Group.prototype ), {
constructor: THREE.HTMLGroup
} );
THREE.HTMLMesh = function ( dom ) {
var texture = new THREE.HTMLTexture( dom );
var geometry = new THREE.PlaneGeometry( texture.image.width * 0.05, texture.image.height * 0.05 );
var material = new THREE.MeshBasicMaterial( { map: texture } );
THREE.Mesh.call( this, geometry, material );
this.type = 'HTMLMesh';
};
THREE.HTMLMesh.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
constructor: THREE.HTMLMesh
} );
THREE.HTMLTexture = function ( dom ) {
THREE.CanvasTexture.call( this, html2canvas( dom ) );
this.dom = dom;
this.anisotropy = 16;
};
THREE.HTMLTexture.prototype = Object.assign( Object.create( THREE.CanvasTexture.prototype ), {
constructor: THREE.HTMLTexture,
update: function () {
console.log( 'yo!', this, this.dom );
this.image = html2canvas( this.dom );
this.needsUpdate = true;
}
} );
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.HTMLGroup = function ( dom ) {
THREE.Group.call( this );
this.type = 'HTMLGroup';
/*
dom.addEventListener( 'mousemove', function ( event ) {
console.log( 'mousemove' );
} );
dom.addEventListener( 'click', function ( event ) {
console.log( 'click' );
} );
*/
};
THREE.HTMLGroup.prototype = Object.assign( Object.create( THREE.Group.prototype ), {
constructor: THREE.HTMLGroup
} );
THREE.HTMLMesh = function ( dom ) {
var texture = new THREE.HTMLTexture( dom );
var geometry = new THREE.PlaneGeometry( texture.image.width * 0.05, texture.image.height * 0.05 );
var material = new THREE.MeshBasicMaterial( { map: texture } );
THREE.Mesh.call( this, geometry, material );
this.type = 'HTMLMesh';
};
THREE.HTMLMesh.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
constructor: THREE.HTMLMesh
} );
THREE.HTMLTexture = function ( dom ) {
THREE.CanvasTexture.call( this, html2canvas( dom ) );
this.dom = dom;
this.anisotropy = 16;
};
THREE.HTMLTexture.prototype = Object.assign( Object.create( THREE.CanvasTexture.prototype ), {
constructor: THREE.HTMLTexture,
update: function () {
console.log( 'yo!', this, this.dom );
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.
先完成此消息的编辑!
想要评论请 注册