Hi,
I got three mesh in a gltf file. I would like to load the geometry of one of them in order to change the color manually:
const Bb = () => {
const { nodes } = useLoader(GLTFLoader, "/low_poly_earth.gltf");
console.log(nodes);
return (
<mesh geometry={nodes.mesh_0.material}>
<meshStandardMaterial color="#ff0000" transparent opacity={0.5} />
</mesh>
);
};
The structure of the glft file should be ok:
but I got a bunch of errors and nothing is rendered. I am new to 3d object file format and I confess I didn’t look around on internet to know how it works but I won’t have to do this kind of work for a while and it’s quite technical.
my code sandbox is here : template_shader - CodeSandbox
The function concerned is inside meshPlanet.js and the gltf file is low_poly_earth.gltf (inside Public folder).
How can I render the geometry inside the gltf ? What is the uri file in it ?