//...
// TEXTURES
const loader = new THREE.TextureLoader();
const sunTexture = loader.load("assets/sun.jpg");
const mercuryTexture = loader.load("assets/mercury.jpg");
//...
// MATERIALS
const sunMaterial = new THREE.MeshStandardMaterial({ map: sunTexture });
const mercuryMaterial = new THREE.MeshStandardMaterial({ map: mercuryTexture });
//...
// MESHES
const geometry = new THREE.SphereGeometry(1, 32, 16);
const sunMesh = new THREE.Mesh(geometry, sunMaterial);
sunMesh.position.set(0, 0, 0);
sunMesh.scale.setScalar(10);
scene.add(sunMesh);
const mercuryGroup = new THREE.Group();
//...
view raw block14.js hosted with ❤ by GitHub