Ejemplo n.º 1
0
    addLevel: function () {
      if ((this._meshes.length - 1) !== this._sel)
        return this.getCurrentMesh();
      var baseMesh = this.getCurrentMesh();
      var newMesh = new MeshResolution(baseMesh.getTransformData(), baseMesh.getRender());
      newMesh.setID(this.getID());
      baseMesh.setVerticesMapping(undefined);

      Subdivision.fullSubdivision(baseMesh, newMesh);
      newMesh.initTopology();

      this.pushMesh(newMesh);
      this.getRender().initRender();
      return newMesh;
    },
Ejemplo n.º 2
0
    computeReverse: function () {
      if (this._sel !== 0)
        return this.getCurrentMesh();
      var baseMesh = this.getCurrentMesh();
      var newMesh = new MeshResolution(baseMesh.getTransformData(), baseMesh.getRender());
      newMesh.setID(this.getID());

      var status = Reversion.computeReverse(baseMesh, newMesh);
      if (!status)
        return;
      newMesh.initTopology();

      this.unshiftMesh(newMesh);
      this.getRender().initRender();
      return newMesh;
    },