How to use the expo-three.THREE.MeshBasicMaterial function in expo-three

To help you get started, we’ve selected a few expo-three examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tidepool-org / viz / src / components / Graph / gl / GraphCbgGl.js View on Github external
constructor(props) {
    // console.log(`GraphCbgGl ctor`);

    super(props);

    const radius = 3.5;
    if (useSprites) {
      this.lowSpriteMaterial = new THREE.MeshBasicMaterial({
        map: GraphCbgGl.lowSpriteTexture,
        transparent: true,
      });
      this.normalSpriteMaterial = new THREE.MeshBasicMaterial({
        map: GraphCbgGl.normalSpriteTexture,
        transparent: true,
      });
      this.highSpriteMaterial = new THREE.MeshBasicMaterial({
        map: GraphCbgGl.highSpriteTexture,
        transparent: true,
      });
      this.spriteGeometry = new THREE.PlaneGeometry(
        radius * 2 * this.pixelRatio,
        radius * 2 * this.pixelRatio,
        1,
        1
github tidepool-org / viz / src / components / Graph / gl / GraphCbgGl.js View on Github external
constructor(props) {
    // console.log(`GraphCbgGl ctor`);

    super(props);

    const radius = 3.5;
    if (useSprites) {
      this.lowSpriteMaterial = new THREE.MeshBasicMaterial({
        map: GraphCbgGl.lowSpriteTexture,
        transparent: true,
      });
      this.normalSpriteMaterial = new THREE.MeshBasicMaterial({
        map: GraphCbgGl.normalSpriteTexture,
        transparent: true,
      });
      this.highSpriteMaterial = new THREE.MeshBasicMaterial({
        map: GraphCbgGl.highSpriteTexture,
        transparent: true,
      });
      this.spriteGeometry = new THREE.PlaneGeometry(
        radius * 2 * this.pixelRatio,
        radius * 2 * this.pixelRatio,
        1,
        1
      );
    } else {
      this.circleGeometry = new THREE.CircleBufferGeometry(
        radius * this.pixelRatio,
github tidepool-org / viz / src / components / Graph / gl / GraphBasalGl.js View on Github external
constructor(props) {
    super(props);

    // FIXME: It seems that the LineDashedMaterial will clip dashes at the end, rather than hiding
    // them, if they don't fit. Ideally we want hide behavior, not clip (similar to the dashed
    // UIBezierPath in the old iOS Tidepool Mobile app).
    this.suppressedLineMaterial = new THREE.LineDashedMaterial({
      color: convertHexColorStringToInt(this.theme.graphBasalLineColor),
      linewidth: 2 * this.pixelRatio,
      dashSize: 2 * this.pixelRatio,
      gapSize: 4 * this.pixelRatio,
    });
    this.basalRectMaterial = new THREE.MeshBasicMaterial({
      color: convertHexColorStringToInt(this.theme.graphBasalRectColor),
    });
  }
github EvanBacon / Expo-Voxel / js / lib / minecraft-skin.js View on Github external
getMaterial = (texture, transparent) => {
    // var texture    = new THREE.MeshLambertMaterial(img);
    texture.magFilter = THREE.NearestFilter;
    texture.minFilter = THREE.NearestFilter;
    texture.format = transparent ? THREE.RGBAFormat : THREE.RGBFormat;
    texture.needsUpdate = true;
    var material = new THREE.MeshBasicMaterial({
      map: texture,
      transparent: transparent ? true : false,
    });
    return material;
  };
github tidepool-org / viz / src / components / Graph / gl / GraphCbgGl.js View on Github external
this.highSpriteMaterial = new THREE.MeshBasicMaterial({
        map: GraphCbgGl.highSpriteTexture,
        transparent: true,
      });
      this.spriteGeometry = new THREE.PlaneGeometry(
        radius * 2 * this.pixelRatio,
        radius * 2 * this.pixelRatio,
        1,
        1
      );
    } else {
      this.circleGeometry = new THREE.CircleBufferGeometry(
        radius * this.pixelRatio,
        8 * this.pixelRatio
      );
      this.lowMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgLowColor),
      });
      this.normalMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgNormalColor),
      });
      this.highMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgHighColor),
      });
    }
  }
github tidepool-org / viz / src / components / Graph / gl / GraphCbgGl.js View on Github external
radius * 2 * this.pixelRatio,
        1,
        1
      );
    } else {
      this.circleGeometry = new THREE.CircleBufferGeometry(
        radius * this.pixelRatio,
        8 * this.pixelRatio
      );
      this.lowMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgLowColor),
      });
      this.normalMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgNormalColor),
      });
      this.highMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgHighColor),
      });
    }
  }
github EvanBacon / Sunset-Cyberspace / game / Background.js View on Github external
setupAsync = async () => {
    //SKY
    this.material = new THREE.MeshBasicMaterial({
      map: await ExpoTHREE.loadAsync(Assets.images['sky.png']),
      transparent: true,
      depthTest: true,
      fog: false,
    });

    const mesh = new THREE.Mesh(
      new THREE.PlaneGeometry(800, 300, 1, 1),
      this.material,
    );
    mesh.scale.set(20, 20, 20);
    mesh.position.z = -3600;
    mesh.position.y = 1800;
    this.add(mesh);
  };
}
github tidepool-org / viz / src / components / Graph / gl / GraphSmbgGl.js View on Github external
transparent: true,
      });
      this.spriteGeometry = new THREE.PlaneGeometry(
        radius * 2 * this.pixelRatio,
        radius * 2 * this.pixelRatio,
        1,
        1
      );
    } else {
      this.lowMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgLowColor),
      });
      this.normalMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgNormalColor),
      });
      this.highMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgHighColor),
      });
      this.circleOutlineGeometry = new THREE.CircleBufferGeometry(
        radius * this.pixelRatio,
        8 * this.pixelRatio
      );
      this.circleGeometry = new THREE.CircleBufferGeometry(
        (radius - 1) * this.pixelRatio,
        8 * this.pixelRatio
      );
    }

    this.backgroundMaterial = new THREE.MeshBasicMaterial({
      color: convertHexColorStringToInt(this.theme.graphBackgroundColor),
    });
  }
github expo / expo-three / example / screens / Effects / RandomJunkNode.js View on Github external
loadAsync = async () => {
    const material = new THREE.MeshBasicMaterial({
      map: await ExpoTHREE.loadTextureAsync({ asset: Assets.icons['ios.png'] }),
    });

    const geometry = new THREE.BoxGeometry(1, 1, 1);
    for (var i = 0; i < 100; i++) {
      const mesh = new THREE.Mesh(geometry, material);
      mesh.position
        .set(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5)
        .normalize();
      mesh.position.multiplyScalar(Math.random() * 400);
      mesh.rotation.set(
        Math.random() * 2,
        Math.random() * 2,
        Math.random() * 2
      );
      mesh.scale.multiplyScalar(Math.random() * 50);
github tidepool-org / viz / src / components / Graph / gl / GraphCbgGl.js View on Github external
});
      this.spriteGeometry = new THREE.PlaneGeometry(
        radius * 2 * this.pixelRatio,
        radius * 2 * this.pixelRatio,
        1,
        1
      );
    } else {
      this.circleGeometry = new THREE.CircleBufferGeometry(
        radius * this.pixelRatio,
        8 * this.pixelRatio
      );
      this.lowMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgLowColor),
      });
      this.normalMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgNormalColor),
      });
      this.highMaterial = new THREE.MeshBasicMaterial({
        color: convertHexColorStringToInt(this.theme.graphBgHighColor),
      });
    }
  }