title: Three.js is not rendering my textures from my planet constructor function
body: <p>I have a function that takes orbital parameters and texture images from a dataset and creates a 3d object (a planet). However for some reason textures aren't being rendered. Using <em>BasicMaterial</em> it works normally, but not with <em>StandardMaterial</em> or <em>PhongMaterial</em>. (There is a point light in the scene), I already tested the textures outside the loop and the function, they work nice. I don´t know what else to do.
  I let here the code.</p>
  <pre><code>for(var i=0;i &lt; results.data.length; i++){
                
   const EC = Number(results.data[i][&quot;Eccentricity&quot;]); //Eccentricity
   const IN = Number(results.data[i][&quot;Inclination [Rad]&quot;]) ; //Inclination
   const OM = Number(results.data[i][&quot;Orbit Rotation_Y [Rad]&quot;]) ; //Longitude of ascending node
   const W = Number(results.data[i][&quot;Orbit Rotation_X [Rad]&quot;]); //Argument of periapsis
   const A = Number(results.data[i][&quot;Orbit semi-major axis [UA]&quot;]); //Semi-major axis
   const EcRadius = Number(results.data[i][&quot;Relative Equatorial Radius&quot;]); //Radius
   const NAM = results.data[i][&quot;Name&quot;]; //Name
   const textureUrl = results.data[i][&quot;TextureFileUrl&quot;]; //Texture image of the planet
  
   const loader = new THREE.TextureLoader();
   loader.load(textureUrl, function ( texture ) {
      // Create the material when the texture is loaded
      var tex = texture.clone();
      const PlanetMaterial = new THREE.MeshBasicMaterial( {
      map: tex
      } );
      scene.add(CreatePlanet( 0,0,0, EC,IN,OM,W,A,EcRadius, NAM, 0x4E4E4E, 0.5, PlanetMaterial ));
      },
    undefined,
    function ( err ) {
       console.error( 'An error happened.');
    }
    );
  } 
  </code></pre>
  <p><code>CreatePlanet</code> function just creates a mesh with the material given. Like:</p>
  <pre><code>const geometryPlanet = new THREE.SphereBufferGeometry(EcRadius, 300, 300);
  const Planet = new THREE.Mesh(geometryPlanet, PlanetMaterial);
  return Planet;
  </code></pre>
  <p>Thanks beforehand for the help.</p>