Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the material for mesh #1655

Open
lixiaojiangw opened this issue Sep 4, 2024 · 0 comments
Open

add the material for mesh #1655

lixiaojiangw opened this issue Sep 4, 2024 · 0 comments
Labels
question Further information is requested

Comments

@lixiaojiangw
Copy link

I want to add the material through the following code, but it does not work. How can I add the material? thank you
(The material is lost when exporting .ifc from SketchUp, after from .ifc convert to .xkt. so I want to add the material in this way)
const xktLoader = new XKTLoaderPlugin(viewer);
const sceneModel = xktLoader.load({
id: "myModel",
manifestSrc: "app/data/projects/test5/models/hongqi/model.manifest.json",
edges: true,
colorTextureEnabled:true
});
.....
sceneModel.on("loaded", () => {
var myMesh = viewer.scene.objects["2hN0_N64f4eBtacYJk9FSu"];
if(myMesh != null)
new Mesh(viewer.scene, {
geometry: new ReadableGeometry(viewer.scene, myMesh.geometry),
material: new SpecularMaterial(viewer.scene, {
// specular: [1.0, 0.0, 0.0],
normalMap: new Texture(viewer.scene, {
src: "assets/myMaterials/material_9.jpg"
})
})
});
.....
thank you.

@lixiaojiangw lixiaojiangw added the question Further information is requested label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant