Skip to content

Instantly share code, notes, and snippets.

@megabayt
Created November 7, 2017 11:03
Show Gist options
  • Save megabayt/98d684a0edbcdbb69dfae5454f4b0f49 to your computer and use it in GitHub Desktop.
Save megabayt/98d684a0edbcdbb69dfae5454f4b0f49 to your computer and use it in GitHub Desktop.
Add room to threejs
//ROOM
var roomGeometry = new THREE.BoxGeometry( 20, 10, 20 );
var roomFrontMaterial = new THREE.MeshPhongMaterial( {
color: 0xffffff,
transparent: true,
opacity: 0.1
} );
var roomFront = new THREE.Mesh( roomGeometry, roomFrontMaterial );
roomFront.position.y = 5;
var roomBackMaterial = new THREE.MeshPhongMaterial( {
color: 0xffffff,
transparent: false,
side: THREE.BackSide
} );
var roomBack = new THREE.Mesh( roomGeometry, roomBackMaterial );
roomBack.position.y = 5;
scene.add( roomFront, roomBack );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment