Hi, Iām loading gltf object to the scene with drag-drop it seems weird I think its need HDR. How can I add hdr to my scene? Thanks
Here is mo code flor load:
const loadGltf = (file) => {
const fileReader = new FileReader();
const onload = (event) => {
const data = event.currentTarget.result;
const gltfLoader = new GLTFLoader();
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath(
"....."
);
gltfLoader.setDRACOLoader(dracoLoader);
gltfLoader.parse(data, "", (gltf) => {
var gltfObject = gltf.scene;
gltfObject.scale.set(1, 1, 1);
gltfObject.position.y = 0; //Position (y = up+, down-)
gltfObject.position.z = 0; // Position (z = front +, back-)*/
scene.add(gltfObject);
render();
});
};
const onerror = (error) => {
};
fileReader.onload = onload;
fileReader.onerror = onerror;
fileReader.readAsArrayBuffer(file);
};