Skip to content

Instantly share code, notes, and snippets.

@marshallmurphy
Created July 28, 2020 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshallmurphy/35d39486fb7f4d1c669dc60151415fb5 to your computer and use it in GitHub Desktop.
Save marshallmurphy/35d39486fb7f4d1c669dc60151415fb5 to your computer and use it in GitHub Desktop.
//...
// 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();
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment