diff --git a/js/fea/dmaCell.js b/js/fea/dmaCell.js index 10efcfc8a036619031ee5371dcc110de9e393d32..75a1250841a933e6269b37820c2319422770d0f2 100644 --- a/js/fea/dmaCell.js +++ b/js/fea/dmaCell.js @@ -39,6 +39,9 @@ this.indices = indices; this.position = this._calcPositionForScale(scale); + this.cellMesh = this._buildCellMesh(this.position); + window.three.sceneAdd(this.cellMesh); + this.parts = this._initParts(this.position); this.drawForMode(mode); } @@ -84,11 +87,7 @@ DMACell.prototype.drawForMode = function(mode){ console.log(mode); if (mode == "cell"){ - if (this.cellMesh) this._setCellMeshVisibility(true); - else { - this.cellMesh = this._buildCellMesh(this.position); - window.three.sceneAdd(this.cellMesh); - } + this._setCellMeshVisibility(true); _.each(this.parts, function(part){ part.hide(); }); diff --git a/js/fea/dmaPart.js b/js/fea/dmaPart.js index 33f0028489b2c5f138a2d691a05b90478d7a53ed..187ee0b99d8a0d86dfcfd3b7fb325ab6417c1055 100644 --- a/js/fea/dmaPart.js +++ b/js/fea/dmaPart.js @@ -35,7 +35,7 @@ DMAPart.prototype._draw = function(){ this.mesh = this._makeMeshForType(this.type); - window.three.sceneAdd(this.mesh); + window.three.sceneAdd(this.mesh, false); }; DMAPart.prototype._makeMeshForType = function(type){