Created
November 7, 2017 11:03
-
-
Save megabayt/98d684a0edbcdbb69dfae5454f4b0f49 to your computer and use it in GitHub Desktop.
Add room to threejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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