Skip to content

Instantly share code, notes, and snippets.

@evejweinberg
Last active November 6, 2016 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evejweinberg/19bb53872d274f9eaa146c4659beb415 to your computer and use it in GitHub Desktop.
Save evejweinberg/19bb53872d274f9eaa146c4659beb415 to your computer and use it in GitHub Desktop.
3js texture loader
var loader2 = new THREE.TextureLoader(loadingManager);
loader2.load('img/Floor.jpg', onTextureLoaded2);
function onTextureLoaded2(texture) {
var geometry = new THREE.PlaneGeometry(512, 512);
var material = new THREE.MeshPhongMaterial({
roughness: .64,
metalness: .81,
transparent: false,
opacity: 1,
color: pink,
map: texture,
// emissive: pink,
// bumpMap: loader2,
bumpScale: 12,
side: THREE.DoubleSide
});
plane = new THREE.Mesh(geometry, material);
scene.add(plane);
plane.receiveShadow = true;
plane.castShadow = true;
// plane.position.y = 1.57;
plane.rotation.x = 1.57;
} //////////DONE LOADING FLOOR //////////
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment