Created
October 18, 2018 15:49
-
-
Save Y0lan/cc137a19a8f6a13f4678bbb9ca145b19 to your computer and use it in GitHub Desktop.
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
function CreateDolmen(x, z){ | |
dolmen = new THREE.Object3D(); | |
var geometry = new THREE.BoxGeometry( 1, 3, 1 ); | |
var textureUrl = 'images/rocks.jpg' | |
var texture = THREE.ImageUtils.loadTexture(textureUrl); | |
texture.wrapS = THREE.RepeatWrapping; | |
texture.wrapT = THREE.RepeatWrapping; | |
texture.repeat.x= 1 | |
texture.repeat.y= 1 | |
texture.anisotropy = renderer.getMaxAnisotropy() | |
var material = new THREE.MeshPhongMaterial({ | |
map : texture, | |
emissive: 'gray', | |
}) | |
//pilier1 | |
pilier1 = new THREE.Mesh( geometry, material ); | |
pilier1.position.set(x,1.25,z); | |
//pilier2 | |
pilier2 = new THREE.Mesh( geometry, material ); | |
pilier2.position.set(x+2,1.25,z); | |
//toit | |
var geometry = new THREE.BoxGeometry( 4, 1, 1.25 ); | |
toit = new THREE.Mesh( geometry, material ); | |
toit.position.set(x+1,3,z); | |
dolmen.add( pilier1 ); | |
dolmen.add( pilier2 ); | |
dolmen.add( toit); | |
dolmen.position.set(x,0,z); | |
dolmen.castShadow = true; | |
dolmen.receiveShadow = false; | |
scene.add( dolmen ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment