Created
July 28, 2020 23:51
-
-
Save marshallmurphy/35d39486fb7f4d1c669dc60151415fb5 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
//... | |
// 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