OSDN Git Service

three.jsをThirdPartyに追加
[webglgame/webgl_framework.git] / webglFramework / Thirdparty / three.js-master / examples / js / nodes / utils / NoiseNode.js
diff --git a/webglFramework/Thirdparty/three.js-master/examples/js/nodes/utils/NoiseNode.js b/webglFramework/Thirdparty/three.js-master/examples/js/nodes/utils/NoiseNode.js
new file mode 100644 (file)
index 0000000..639d927
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * @author sunag / http://www.sunag.com.br/
+ */
+
+THREE.NoiseNode = function( coord ) {
+
+       THREE.TempNode.call( this, 'fv1' );
+
+       this.coord = coord;
+
+};
+
+THREE.NoiseNode.prototype = Object.create( THREE.TempNode.prototype );
+THREE.NoiseNode.prototype.constructor = THREE.NoiseNode;
+
+THREE.NoiseNode.prototype.generate = function( builder, output ) {
+
+       builder.include( 'snoise' );
+
+       return builder.format( 'snoise(' + this.coord.build( builder, 'v2' ) + ')', this.getType( builder ), output );
+
+};