Skip to content

Instantly share code, notes, and snippets.

@mrdoob
Last active August 29, 2015 13:57
Show Gist options
  • Save mrdoob/9584455 to your computer and use it in GitHub Desktop.
Save mrdoob/9584455 to your computer and use it in GitHub Desktop.
define( [ 'WebGLRendererModule' ], function ( renderer ) {
return function () {
return new FRAME.Module( {
parameters: {
color: new FRAME.ModuleParameter.Color( 'Color', 0xffffff ),
opacity: new FRAME.ModuleParameter.Float( 'Opacity', 1, 0, 1 )
},
init: function () {
this.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );
this.scene = new THREE.Scene();
this.geometry = new THREE.PlaneGeometry( 2, 2 );
this.material = new THREE.MeshBasicMaterial( { depthTest: false, depthWrite: false, transparent: true } );
this.scene.add( new THREE.Mesh( this.geometry, this.material ) );
},
update: function () {
this.material.color.setHex( this.parameters.color.value );
this.material.opacity = this.parameters.opacity.value;
renderer.render( this.scene, this.camera );
}
} );
};
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment