How to use the three.MeshLambertMaterial function in three

To help you get started, we’ve selected a few 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 cvdlab / react-planner / demo / src / catalog / items / canteen-table / planner-element.jsx View on Github external
import * as Three from 'three';
import React from 'react';

const WIDTH =  100;
const DEPTH =  140;
const HEIGHT = 100;

const brown = new Three.MeshLambertMaterial({color: 0xac6c25});
const black = new Three.MeshLambertMaterial({color: 0x000000});
const grey = new Three.MeshLambertMaterial({color: 0xC0C0C0});

const objectMaxLOD = makeObjectMaxLOD();
const objectMinLOD = makeObjectMinLOD();

function makeObjectMaxLOD() {

  //central pillar
  let centralPillar = new Three.BoxGeometry(1,3,1);
  let canteen_table = new Three.Mesh(centralPillar,grey);

  // plane top
  let planeTop = new Three.Mesh(new Three.BoxGeometry(10,0.5,10),brown);
  planeTop.position.set(0,1.5,0);
  canteen_table.add(planeTop);

  //plane nuts
github cvdlab / react-planner / demo / src / catalog / items / camera / planner-element.jsx View on Github external
import * as Three from 'three';
import React from 'react';

const WIDTH = 10;
const DEPTH = 20;
const HEIGHT = 20;

const grey = new Three.MeshLambertMaterial({color:0xaaaaaa});
const black = new Three.MeshLambertMaterial({color:0x000000});
const white = new Three.MeshLambertMaterial({color:0xffffff});
const glassMaterial = new Three.MeshLambertMaterial({color:0xffffff, transparent: true, opacity:0.5});

const objectMaxLOD = makeObjectMaxLOD();
const objectMinLOD = makeObjectMinLOD();

function makeObjectMaxLOD(){

  let video_camera = new Three.Mesh();

  let cylinderGeometry = new Three.CylinderGeometry(0.2,0.2,0.5,80);
  let body = new Three.Mesh(cylinderGeometry,grey);
  body.rotation.x+= Math.PI/2;
  body.position.set(0,0.5,0);

  let geometrySphereUp = new Three.SphereGeometry( 0.2, 32, 32 );
github cvdlab / react-planner / demo / src / catalog / items / three-phase-panel / planner-element.jsx View on Github external
import * as Three from 'three';
import React from 'react';

const WIDTH = 40;
const DEPTH = 20;
const HEIGHT = 50;

const grey = new Three.MeshLambertMaterial({color:0xAAAAAA});
grey.side = Three.DoubleSide;
const red = new Three.MeshPhongMaterial({color:0xAA0000});
const blue = new Three.MeshPhongMaterial({color:0x0000AA} );
const black = new Three.MeshLambertMaterial({color:0x000000});
black.side=Three.DoubleSide;

const textureLoader = new Three.TextureLoader();
const quadro=textureLoader.load(require('./PanelTexture.png'));


const objectMaxLOD = makeObjectMaxLOD();
const objectMiddleLOD = makeObjectMiddleLOD();
const objectMinLOD = makeObjectMinLOD();
github cvdlab / react-planner / demo / src / catalog / items / teaching-post / planner-element.jsx View on Github external
p4.rotation.x += Math.PI / 2;
      p4.position.z += 0.5 / 2;
      p4.position.y += 0.4;
      p4.position.x += 0.4;

      let p5 = new Three.Mesh(geometry, material);
      p5.rotation.x += Math.PI / 2;
      p5.position.z += 0.5 * 3 / 2;

      let p6 = new Three.Mesh(geometry, material);
      p6.rotation.x += Math.PI / 2;
      p6.position.z += 0.5 * 3 / 2;
      p6.position.x += 0.4;

      let texture = new Three.TextureLoader().load(require('./wood.jpg'));
      let materialTexture = new Three.MeshLambertMaterial({map: texture});

      let roundedRectShape = new Three.Shape();

      let x = 0;
      let y = 0;
      let width = .5;
      let height = .48;
      let radius = 0.05;

      roundedRectShape.moveTo(x, y + radius);
      roundedRectShape.lineTo(x, y + height - radius);
      roundedRectShape.quadraticCurveTo(x, y + height, x + radius, y + height);
      roundedRectShape.lineTo(x + width - radius, y + height);
      roundedRectShape.quadraticCurveTo(x + width, y + height, x + width, y + height - radius);
      roundedRectShape.lineTo(x + width, y + radius);
      roundedRectShape.quadraticCurveTo(x + width, y, x + width - radius, y);
github agrande / lba2remake / src / game / points.ts View on Github external
const controlNode = camera.controlNode;
        if (!controlNode)
            return;

        EULER.setFromQuaternion(controlNode.quaternion, 'YXZ');
        EULER.y += Math.PI;
        EULER.x = 0;
        EULER.z = 0;

        flag.quaternion.setFromEuler(EULER);
    };

    return point;
}

const stickMaterial = new THREE.MeshLambertMaterial({
    color: new THREE.Color('#84572e')
});

function makeFlag(texture) {
    const stickGeom = new THREE.CylinderBufferGeometry(0.036, 0.036, 0.96, 6, 1, false);
    const stick = new THREE.Mesh(stickGeom, stickMaterial);
    stick.position.set(0, 0.48, 0);
    stick.name = 'stick';

    const clothMaterial = new THREE.MeshBasicMaterial({
        map: texture,
        transparent: true
    });

    const clothGeom = new THREE.PlaneBufferGeometry(0.7, 0.7);
    const cloth = new THREE.Mesh(clothGeom, clothMaterial);
github salomonelli / nirania / old / js / protagonist / Body.js View on Github external
constructor(){
    this.material = new THREE.MeshLambertMaterial({
        color: 0xffffff,
        transparent: false,
        opacity: 0.8
    });
    this.mesh = new THREE.Mesh(Body.geometry, this.material);
  }
github cvdlab / react-planner / demo / src / catalog / items / bookcase / planner-element.jsx View on Github external
bookcase.add(shelve);
  }

  function choiceTexture() {

    return (Math.floor(Math.random() * 3))

  }

  //book
  let bookGeometry = new Three.BoxGeometry(0.24,0.32,0.76);

  let bookMaterial =
    [ new Three.MeshLambertMaterial({map:bookTexture1}),
      new Three.MeshLambertMaterial({map:bookTexture2}),
      new Three.MeshLambertMaterial({map:bookTexture3})];

  let book1 = new Three.Mesh(bookGeometry,bookMaterial[choiceTexture()]);
  book1.position.set(0.15,0.59,0);
  bookcase.add(book1);

  let book2 = new Three.Mesh(bookGeometry,bookMaterial[choiceTexture()]);
  book2.position.set(0.15,0.99,0);
  bookcase.add(book2);

  let book3 = new Three.Mesh(bookGeometry,bookMaterial[choiceTexture()]);
  book3.position.set(0.15,0.19,0);
  bookcase.add(book3);

  let book4 = new Three.Mesh(bookGeometry,bookMaterial[choiceTexture()]);
  book4.position.set(0.15,1.39,0);
  bookcase.add(book4);
github cvdlab / react-planner / demo / src / catalog / holes / panic-door / planner-element.jsx View on Github external
import React from 'react';
import * as Three from 'three';

const black = new Three.MeshLambertMaterial({color : 0x000000});
const green = new Three.MeshLambertMaterial( {color : 0x348781});
const red = new Three.MeshLambertMaterial({color : 0xFF0000});
const turquoise = new Three.MeshLambertMaterial({color : 0x43C6DB,opacity :0.7,transparent: true});
const metalBlue = new Three.MeshLambertMaterial({color : 0xB7CEEC});
const darkGrey = new Three.MeshLambertMaterial({color : 0x313131});
const darkGrey2 = new Three.MeshLambertMaterial({color : 0x212121});
const metalBlueGrey = new Three.MeshLambertMaterial({color : 0x566D7E});

let flip_value;
let handleSide_value;

function makePanicDoor(handleSide) {

  let panicDoor = new Three.Mesh();
  let leftDoor = makeDoorStructure();
  let handle = makeHandle(handleSide);
  let leftDoorPivot = makePivot();
  let rightDoorPivot = makePivot();
  let safetyHandleLeft = makeSafetyHandle();
  let safetyHandleRight = makeSafetyHandle();
  let hilt = makeLock();
  let doorLock = makeDoorLock();
github Boodo-FE / SkyNote / src / objects / boy / head.js View on Github external
constructor(option) {
        let r = option.size;
        var sphereMaterial = new THREE.MeshLambertMaterial({
            color: option.color,
            shading: THREE.FlatShading
        });
        this.sphere = new THREE.Mesh(
            new THREE.SphereGeometry(r, 50, 50),
            sphereMaterial
        );
        this.sphere.position.set(0, -option.bellySize / 2 - r * 0.6, 0);
        this.sphere.geometry.verticesNeedUpdate = true;
        this.sphere.geometry.normalsNeedUpdate = true;
    }