From 86c7dc0ab4f072179e82b2c2ddb1cf98d672d47c Mon Sep 17 00:00:00 2001 From: martinRenou Date: Sun, 30 Jun 2019 16:22:12 +0200 Subject: [PATCH] transform -> position --- js/lib/src/BlockUtils/Block.js | 8 ++++---- js/lib/src/BlockUtils/DataBlock.js | 3 --- js/lib/src/BlockUtils/PlugInBlock.js | 4 ++-- js/lib/src/BlockUtils/PlugIns/IsoSurfaceUtils.js | 1 - 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/js/lib/src/BlockUtils/Block.js b/js/lib/src/BlockUtils/Block.js index 2190444..5511f2d 100644 --- a/js/lib/src/BlockUtils/Block.js +++ b/js/lib/src/BlockUtils/Block.js @@ -460,22 +460,22 @@ class Block { ); }); - // To display surfaces like 2D planes or iso-surfaces whatever + // For displaying surfaces like 2D planes or iso-surfaces whatever // the point of view mesh.material.side = THREE.DoubleSide; + mesh.material.alphaTest = 0.1; + // Set wireframe status and shading if (mesh.type !== 'LineSegments' && mesh.type !== 'Points') { mesh.material.wireframe = this._wireframe; mesh.material.flatShading = !this._wireframe; } else { mesh.material.wireframe = false; - // Why ? - // mesh.material.shading = THREE.SmoothShading; } // Get isoColor node - mesh.material.transform = position; + mesh.material.position = position; mesh.material.alpha = alpha; mesh.material.color = color; mesh.material.build(); diff --git a/js/lib/src/BlockUtils/DataBlock.js b/js/lib/src/BlockUtils/DataBlock.js index b735216..d88d987 100644 --- a/js/lib/src/BlockUtils/DataBlock.js +++ b/js/lib/src/BlockUtils/DataBlock.js @@ -62,9 +62,6 @@ class DataBlock extends Block { this._material._colorVaryingNodes = []; this._material._alphaVaryingNodes = []; - // Disable backface culling (to fix display issues with planes) - this._material.side = THREE.DoubleSide; - // Initialize mesh position/rotation/scale this._meshes.push( new THREE.Mesh(this._bufferGeometry, this._material) diff --git a/js/lib/src/BlockUtils/PlugInBlock.js b/js/lib/src/BlockUtils/PlugInBlock.js index 2606814..ad93d4b 100644 --- a/js/lib/src/BlockUtils/PlugInBlock.js +++ b/js/lib/src/BlockUtils/PlugInBlock.js @@ -587,8 +587,8 @@ class PlugInBlock extends Block { let setCustomVarCall = new Nodes.FunctionCallNode(setCustomVar); - if (this._meshes[0].material.transform) { - setCustomVarCall.inputs.pos = this._meshes[0].material.transform; + if (this._meshes[0].material.position) { + setCustomVarCall.inputs.pos = this._meshes[0].material.position; } else { setCustomVarCall.inputs.pos = new Nodes.PositionNode(); } diff --git a/js/lib/src/BlockUtils/PlugIns/IsoSurfaceUtils.js b/js/lib/src/BlockUtils/PlugIns/IsoSurfaceUtils.js index cf19e31..4c01742 100644 --- a/js/lib/src/BlockUtils/PlugIns/IsoSurfaceUtils.js +++ b/js/lib/src/BlockUtils/PlugIns/IsoSurfaceUtils.js @@ -33,7 +33,6 @@ class IsoSurfaceUtils { this._Emax = undefined; this.surfaceMaterial = block.getCurrentMaterial(); - this.surfaceMaterial.side = THREE.DoubleSide; } _createTree (array, value = 'min') {