# Three JS how to add color and line thickness to mesh loaded with GLTFLoader

**URL:** <https://discourse.threejs.org/t/three-js-how-to-add-color-and-line-thickness-to-mesh-loaded-with-gltfloader/17544>\
**Category:** Questions\
**Tags:** color, wireframe, loaders\
**Created:** [July 30, 2020, 11:02pm UTC](https://discourse.threejs.org/t/three-js-how-to-add-color-and-line-thickness-to-mesh-loaded-with-gltfloader/17544 "2020-07-30T23:02:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiesfa](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@tiesfa](https://discourse.threejs.org/u/tiesfa)\
**Post date:** [July 30, 2020, 11:02pm UTC](https://discourse.threejs.org/t/three-js-how-to-add-color-and-line-thickness-to-mesh-loaded-with-gltfloader/17544/1 "2020-07-30T23:02:31Z")

</div>

So far I managed to load a mesh with GLTFLoader and turn it into a wireframe. I’m stuck at the part where I want to color it and give it a line thickness. I don’t completely understand how to use traverse().

My code so far:

```
var loader = new THREE.GLTFLoader(); loader.load('model.glb', handle_load);

var mesh;

function handle_load(gltf) {
  mesh = gltf.scene;
  mesh.traverse((node) => {
    if (!node.isMesh) return;
    node.material.wireframe = true;
  });
  scene.add(mesh);
  mesh.position.z = 2;
}
```

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [July 31, 2020, 12:09am UTC](https://discourse.threejs.org/t/three-js-how-to-add-color-and-line-thickness-to-mesh-loaded-with-gltfloader/17544/2 "2020-07-31T00:09:31Z")

</div>

The material will be a [THREE.MeshStandardMaterial](https://threejs.org/docs/#api/en/materials/MeshStandardMaterial), so you can use any of the options there (like `material.color.setHex( 0xFF0000 )`) to change its appearance. Note the [warning about `wireframeLinewidth`](https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.wireframeLinewidth), " Due to limitations of the [OpenGL Core Profile](https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf) with the WebGL renderer on most platforms linewidth will always be 1 regardless of the set value.".

There are ways around that, but they vary in difficulty and performance-intensiveness:

- [https://stackoverflow.com/questions/41900304/threejs-why-is-wireframe-thickness-not-adjusting-for-me](https://stackoverflow.com/questions/41900304/threejs-why-is-wireframe-thickness-not-adjusting-for-me)
- [https://github.com/mattdesl/three-tube-wireframe](https://github.com/mattdesl/three-tube-wireframe)
- [https://github.com/mattdesl/webgl-wireframes](https://github.com/mattdesl/webgl-wireframes)
