Forge Viewer THREE.MeshLambertMaterial

2019-03-03 08:32发布

问题:

One of the properties available on the var material = NEW THREE.MeshLambertMaterial is texture maps: {( map: new THREE.TextureLoader().load('wool.jpg') )}

We're very curious whether it would be possible to load in a texture this way and apply it to a specific object in the model?

回答1:

Yes, but the way you modify materials in the Forge Viewer is a little bit different than what you would do in Three.js.

I have an extensive sample that illustrates how to modify materials, including custom textures here:

Viewing.Extension.Material

The live demo is there. To use it, load a model first with "Model Loader" +, then activate either "Theming color", "Material color" or "Texture" and pick a component of the loaded model. You can click in the square in each option to change color/texture.