title: Import STL files by Qt3D module: how to do configuration of light and material
body: <p>I have used somebody's code uploaded <a href="https://bitbucket.org/amahta/3d_viewer" rel="nofollow noreferrer">here on Bitbucket</a> to open and view STL files with Qt3D. The code has an entity which corresponds to imported STL model:</p>
  
  <pre><code>        Entity
          {
              id: monkeyEntity
              components: [
                  SceneLoader
                  {
                      id: sceneLoader
                  }
              ]
          }
  </code></pre>
  
  <p>The above <code>sceneLoader</code> is loading the imported STL model by a QML dialog:</p>
  
  <pre><code>FileDialog
  {
      id: fileDialog
      onAccepted:
      {
          sceneLoader.source = fileDialog.fileUrl
      }
  }
  </code></pre>
  
  <p>But when I import the STL files, the lighting is not working. No matter how I change the light or material the imported 3D STL model is all white without showing the 3D shape:</p>
  
  <p><a href="https://i.stack.imgur.com/KZvge.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KZvge.png" alt="STL model is all white, not showing the 3D shape"></a></p>
  
  <p>However when I use <a href="https://www.blender.org" rel="nofollow noreferrer">Blender software</a> to convert STL file to Wavefront OBJ file, then the imported OBJ file into the Qt3D app shows up properly:</p>
  
  <p><a href="https://i.stack.imgur.com/bWX7e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bWX7e.png" alt="Wavefront OBJ model is viewed properly"></a></p>
  
  <hr>
  
  <p>I tried many light and material features of Qt3D but I couldn't make the STL model be viewed properly. Can anyone provide an example of Qt3D light/material configuration which would work for STL files?</p>