Skip to content
Snippets Groups Projects
Commit 1a9720fc authored by RIFI Zaynab's avatar RIFI Zaynab
Browse files

Update file script.js

parent 7fb157ef
No related branches found
No related tags found
No related merge requests found
...@@ -396,30 +396,31 @@ function loadInk() { ...@@ -396,30 +396,31 @@ function loadInk() {
const loader = new OBJLoader(); const loader = new OBJLoader();
loader.load( loader.load(
'encre.obj', 'encre.obj',
function (encre) { function (encre) {
encre.scale.set(30, 30, 30); encre.scale.set(30, 30, 30);
encre.position.set(-100, -70, -120); encre.position.set(-100, -70, -120);
encre.rotation.set(0, 0, 0); encre.rotation.set(0, 0, 0);
const encreMaterial = new THREE.MeshStandardMaterial({ const encreMaterial = new THREE.MeshStandardMaterial({
map: texture, color: 0x000000,
roughness: 0.5, roughness: 0.5,
metalness: 0.3, metalness: 0.3,
transparent: true, transparent: true,
opacity: 0.95 opacity: 0.95
}); });
encre.traverse(function(child) { encre.traverse(function(child) {
if (child.isMesh) { if (child.isMesh) {
child.material = encreMaterial; child.material = encreMaterial;
child.castShadow = true; child.castShadow = true;
child.receiveShadow = true; child.receiveShadow = true;
} }
}); });
scene.add(encre); scene.add(encre);
console.log("Objet chargé :", encre); console.log("Objet chargé :", encre);
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment