Currently, I am in the process of creating a basic solar system and facing an issue with making the Sun a light source while also incorporating an image to represent the sun. The code I've implemented allows it to function as a light source; however, it appears as a black circle instead of the desired appearance. Any suggestions or ideas on how to resolve this dilemma?
//Integrating the depiction of the Sun
geometry1 = new THREE.SphereGeometry( 100, 32, 32 );
light = new THREE.PointLight( 0xffffff, 1, 5000 );
material1 = new THREE.MeshStandardMaterial( {
// emissive: 0xff00ff,
// emissiveIntensity: 1,
map: THREE.ImageUtils.loadTexture('sun.jpg'),
color: 0xffffff,
side: THREE.FrontSide
});
light.add(new THREE.Mesh(geometry1, material1));
light.position.set(0,0,0);
light.castShadow = true;
The current scene displays the Earth illuminated by light from the Sun.
This is the implemented code for generating the representation of the sun, subsequently added to the existing scene. Thank you for any insight provided!