Forge Viewer THREE.MeshLambertMaterial [英] Forge Viewer THREE.MeshLambertMaterial

查看:37
本文介绍了Forge Viewer THREE.MeshLambertMaterial的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

var material = NEW THREE.MeshLambertMaterial 上可用的属性之一是纹理贴图:{( map: new THREE.TextureLoader().load('wool.jpg'))}

我们很好奇是否可以通过这种方式加载纹理并将其应用于模型中的特定对象?

解决方案

是的,但是您在 Forge Viewer 中修改材料的方式与您在 Three.js 中所做的有点不同.

我有一个广泛的示例来说明如何修改材质,包括此处的自定义纹理:

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?

解决方案

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.

这篇关于Forge Viewer THREE.MeshLambertMaterial的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆