#how can i add the colors in a gltf model with multiple meshes
7 messages · Page 1 of 1 (latest)
you need to add Directional Light to the seen first!
I had both directional light and ambient light
Open console an check if you have errors there!
There was no error
Isnt there a manual way to add colors?
you can just add it like so
`export const Toilet = (
props: BlueprintElement<BlueprintModelConfiguration> & BlueprintObjectProps
) => {
// @ts-ignore
const { nodes, materials } = useGLTF(
path('/assets/models/toilet.glb')
) as GLTFResult;
const highlight = props.selected || props.active;
return (
<group
name={props.id}
position={props.position}
rotation={[0.0, props.rotation, 0.0]}
scale={props.scale}
dispose={null}
>
<Suspense fallback={null}>
<mesh geometry={nodes.Object_3.geometry} rotation={[0.0, 0.0, 0.0]}>
// Add color
<meshBasicMaterial color="#00ff00" />
<Edges
scale={1.0}
threshold={15}
color={highlight ? '#0000ff' : '#000000'}
/>
{props.children}
</mesh>
</Suspense>
</group>
);
};
useGLTF.preload(path('/assets/models/toilet.glb'));`