Jump to content

textures not applying to the converted model


Recommended Posts

Hi all,


am trying to convert my obj and fbx model with the online converter which i found here http://www.babylonjs.com/converter.html


am trying few days,i can convert the model as .babylon format, but after that am trying to load my model on the babylon.js


but i can't see any textures applied to my converted model, what is wrong ? what i have to do here ? am struggling here with the last 3 days, but no clue


attached is my `iPhone5_FBX.zip` which is my source file and output(1).zip is my output file which i got from the converter page







Link to comment
Share on other sites

It is possible that your object is a huge scale and can not be seen loading.
did you try to reduce the scale :
mesh.scaling= new BABYLON.Vector3(0.3, 0.3, 0.3);//ormesh.scaling= new BABYLON.Vector3(0.03, 0.03, 0.03);
And use maxZ of the camera :
camera.maxZ = 10000;

also make sure that the images are in the same directory as the file babylon

Link to comment
Share on other sites

HI dad72,


Nope i doesn't tried, am novice to 3d programming


Following is my code, i added the camera as you said and how can i add the mesh ?

    <script>        var canvas = document.getElementById("renderCanvas");        var engine = new BABYLON.Engine(canvas, true);        var createScene = function () {            var scene = new BABYLON.Scene(engine);                    //Adding a light            var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 20, 100), scene);                    //Adding an Arc Rotate Camera            var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, new BABYLON.Vector3.Zero(), scene);            camera.attachControl(canvas, false);            camera.maxZ = 10000;            // The first parameter can be used to specify which mesh to import. Here we import all meshes                        BABYLON.SceneLoader.ImportMesh("", "scenes/iphone_5/", "super.babylon", scene, function (newMeshes) {                // Set the target of the camera to the first imported mesh                camera.target = newMeshes[0];            });                    // Move the light with the camera            scene.registerBeforeRender(function () {                light.position = camera.position;            });                    return scene;        }                var scene = createScene();        engine.runRenderLoop(function () {            scene.render();        });        // Resize        window.addEventListener("resize", function () {            engine.resize();        });    </script>

please help me to fix it

Link to comment
Share on other sites

for the camera, I modified alpha and beta 

 //Adding an Arc Rotate Camera var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 20, new BABYLON.Vector3(0, 4, 0), scene); camera.attachControl(canvas, false); camera.maxZ = 10000;

For the mesh

BABYLON.SceneLoader.ImportMesh("", "scenes/iphone_5/", "super.babylon", scene, function (newMeshes) {          var mesh = newMeshes[0];          mesh.position = BABYLON.Vector3.Zero;          mesh.scaling= new BABYLON.Vector3(0.03, 0.03, 0.03);       });

And for : var scene = createScene();


delete  "var scene =" is useless


Then create a global variable for use in several functions:


var canvas = document.getElementById("renderCanvas");

var engine = new BABYLON.Engine(canvas, true);

var scene = null;


Do not forget to remove the var keyword in your function


var createScene = function () {
var scene = new BABYLON.Scene(engine);

Link to comment
Share on other sites

Images must be in the same directory as the file.

What do you converted with your models? The "exporter online" renames the images.

Try to convert your object with 3ds max plugin and available for export in .babylon


You are not far to get there, you already have your models on the screen, this is a good start encouraging.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...