Unable to load .obj file from local path

Try to render using below code :
SceneLoader.Append(“assets/images/”, “teapot.obj”, scene, function (scene) {
scene.createDefaultCameraOrLight(true, true, true)
camera.alpha += Math.PI;
});
Occurs error while loading obj file


Sample file :
teapot.zip (44.1 KB)
;

You dont have the file loaders included maybe?

1 Like

Hi,
Facing the same issue after installing the @babylonjs/loader in typescript file


What is wrong with that

you can try to add in

Append(“assets/images/”, “teapot.obj”, scene,` function (scene) {
scene.createDefaultCameraOrLight(true, true, true)
camera.alpha += Math.PI;
}`,
`function (scene) {}`,// <== on proccess
`function (scene) {}`,// <== on error
`'.obj'` // type of file <== without this i cant load scene
)

Currently using SceneLoader from @babylon/core
If I am importing @babylon/loader in typescript file like import ‘@babylonjs/loaders/OBJ’; facing this issue

Hello @Bhavna just checking in, are you still having issues?