ParticleCircleMaterial working again with CanvasRenderer

This commit is contained in:
Mr.doob
2010-11-13 03:42:13 +00:00
parent ce3d641ff2
commit 237f165555
12 changed files with 122 additions and 57 deletions
+29 -4
View File
@@ -1,15 +1,40 @@
/**
* @author mr.doob / http://mrdoob.com/
*
* parameters = {
* color: <hex>,
* map: new THREE.UVMap( <Image> ),
* opacity: <float>,
* blending: THREE.NormalBlending
* }
*/
THREE.ParticleBitmapMaterial = function ( bitmap ) {
THREE.ParticleBasicMaterial = function ( parameters ) {
this.bitmap = bitmap;
this.offset = new THREE.Vector2();
this.color = new THREE.Color( 0xff0000 );
this.map = null;
this.opacity = 1;
this.blending = THREE.NormalBlending;
this.offset = new THREE.Vector2(); // TODO: expose to parameters
if ( parameters ) {
if ( parameters.color !== undefined ) this.color.setHex( parameters.color );
if ( parameters.map !== undefined ) this.map = parameters.map;
if ( parameters.opacity !== undefined ) this.opacity = parameters.opacity;
if ( parameters.blending !== undefined ) this.blending = parameters.blending;
}
this.toString = function () {
return 'THREE.ParticleBitmapMaterial ( bitmap: ' + this.bitmap + ' )';
return 'THREE.ParticleBasicMaterial (<br/>' +
'color: ' + this.color + '<br/>' +
'map: ' + this.map + '<br/>' +
'opacity: ' + this.opacity + '<br/>' +
'blending: ' + this.blending + '<br/>' +
')';
};