.obj file not loading


I want to try to load any .obj file in my playground, I just checked your obj file loader code in my local machine, but did not show any obj file, also it show error

Uncaught Error: No camera defined

please give me proper example or code that will work fine.
i will given the example code but its not working

    <title>Babylon.js sample code</title>

    <!-- Babylon.js -->
    <script src="https://code.jquery.com/pep/0.4.2/pep.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.2/dat.gui.min.js"></script>
    <script src="https://preview.babylonjs.com/ammo.js"></script>
    <script src="https://preview.babylonjs.com/cannon.js"></script>
    <script src="https://preview.babylonjs.com/Oimo.js"></script>
    <script src="https://preview.babylonjs.com/gltf_validator.js"></script>
    <script src="https://preview.babylonjs.com/earcut.min.js"></script>
    <script src="https://preview.babylonjs.com/babylon.js"></script>
    <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
    <script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
    <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.js"></script>
    <script src="https://preview.babylonjs.com/serializers/babylonjs.serializers.min.js"></script>
    <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>

        html, body {
            overflow: hidden;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;

        #renderCanvas {
            width: 100%;
            height: 100%;
            touch-action: none;
var canvas = document.getElementById("renderCanvas");
    var delayCreateScene = function () {
        var scene = new BABYLON.Scene(engine);  

// BABYLON.SceneLoader.ImportMesh("", “scenes/”, “StanfordBunny.obj”, scene, function (meshes) {
// scene.createDefaultCameraOrLight(true, true, true);
// scene.createDefaultEnvironment();
// });

		BABYLON.SceneLoader.Append("scenes/", "StanfordBunny.obj", scene, function (scene) {
			scene.createDefaultCameraOrLight(true, true, true);
        return scene;
    var engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true });
    var scene = delayCreateScene();

    engine.runRenderLoop(function () {
        if (scene) {

    // Resize
    window.addEventListener("resize", function () {

please check and give your valuable feedback.

Thanks & regards,
Arnab Mandal

well the error seems pretty obvious to me :slight_smile:

Just call scene.createDefaultCamera()

Thanks for your suggestion

How do I add multiple texture file in my screen with respective .obj file. which has .png extension.

Thanks ,
Arnab Mandal

Sorry can you elaborate a bit more? Do you want to display textures on your models?

Yes I want to display my texture on my model which has same folder path with .obj file and .mtl file.

So basically you should be able to do something like:

mesh.material.diffuseTexture = new BABYLON.Texture("path_to_your_texture")

Texture not showing properly my code is like that

BABYLON.SceneLoader.ImportMesh("", “scenes/male_obj/”, “male_1.obj”, scene, function (meshes) {
scene.createDefaultCameraOrLight(true, true, true);

            var helper = scene.createDefaultEnvironment();
            var mesh = new BABYLON.StandardMaterial("", scene);
            mesh.material.diffuseTexture = new BABYLON.Texture("scenes/male_obj/Muscles_Torso_Dif.jpg");

Can you repro in the playground?.
Maybe your object had no uv?