Jump to content

Doubt about inverted texture


none-9999
 Share

Recommended Posts

I have no clue what you are doing wrong now... Everything worked for me when I imported.

proof.thumb.png.97ec66f573374fbc1be587fd215df46f.png
That is in BJS

Here is the code I used:
 

var canvas = document.getElementById("renderCanvas"); // Get the canvas element 

            var engine = new BABYLON.Engine(canvas, true); // Generate the BABYLON 3D engine

			BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true;

            var createScene = function () {

                        // Create the scene space
                        var scene = new BABYLON.Scene(engine);

                        // Add a camera to the scene and attach it to the canvas
                        var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 10, BABYLON.Vector3.Zero(), scene);
                        camera.attachControl(canvas, true);

                        // Add lights to the scene
                        var light1 = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(1, 1, 0), scene);
                        var light2 = new BABYLON.PointLight("light2", new BABYLON.Vector3(0, 1, -1), scene);
						
						light1.intensity = 0.5;
						light2.intensity = 0.45;
						
						var loader = new BABYLON.AssetsManager(scene);
						var shipLoad = loader.addMeshTask("ship", "", "./", "naveTierraSolo.obj");
						loader.load();
						
						shipLoad.onSuccess = function (task) {
							var ship = task.loadedMeshes[0];
							ship.material = new BABYLON.StandardMaterial("shipMat", scene);
							ship.material.diffuseTexture = new BABYLON.Texture("./texture.png", scene);
						}
						
						

                        return scene;
                };


                var scene = createScene(); //Call the createScene function

            engine.runRenderLoop(function () { // Register a render loop to repeatedly render the scene
                    scene.render();
            });


            window.addEventListener("resize", function () { // Watch for browser/canvas resize events
                    engine.resize();
            });

naveTierraSolo.obj <- is the OBJ I exported from c4d from your obj file... all I did was make one fix to the nose where a face was not a quad or a triangle.

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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