{
const scene = new THREE.Scene();
const sizes = {
width: 400,
heigth: 400
}
const camera = new THREE.PerspectiveCamera(75, sizes.width / sizes.heigth, 0.1, 100);
camera.position.x = 1;
camera.position.y = 1;
camera.position.z = 4;
camera.rotation.y = 6 * Math.PI / 180;
const dogGeometry = new THREE.BoxGeometry(1, 1, 1);
const dogMaterial = new THREE.MeshStandardMaterial({
color: 0xffffff,
roughness: 0.7,
metalness: 0,
map: new THREE.TextureLoader().load('ruta/a/la/textura.jpg'),
});
const dog = new THREE.Mesh(dogGeometry, dogMaterial);
scene.add(dog);
const light = new THREE.PointLight(0xffffff, 1, 100);
light.position.set(0, 0, 10);
scene.add(light);
scene.background = new THREE.Color('#e2e2e2');
const renderer = new THREE.WebGLRenderer({
canvas: document.querySelector('.webgl')
})
renderer.setSize(sizes.width, sizes.heigth);
renderer.render(scene, camera);
}