mout99

Members
  • Content Count

    45
  • Joined

  • Last visited

About mout99

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I still can not solve it, I can only put a material when it has no .mtl file, I need help
  2. I'm doing a short-term project, so I'm out of time
  3. These are borrowed files, I do not know how to create a 3d file
  4. Thanks for the answers, but there is one thing I still do not understand, the problem is in the code or in the program to create 3D?
  5. Hello, I'm making a page to see 3D objects with a .obj loader, this page has a menu that, when tight, changes the scene, So I'm just changing the location of the file and the name Code: BABYLON.SceneLoader.ImportMesh("", caminho, arquivo, scene, function (newMeshes) // caminho = way // arquivo = file These values I get from a function The problem is that when I change the scene he applies the materials of the previous scene in the current scene, what am I doing wrong? $scope.load3d = function(caminho,arquivo){ $state.go('app.interna', null, {reload: true}); var canvas = document.querySelector("#renderCanvas"); var engine = new BABYLON.Engine(canvas, false); var createScene = function () { var scene = new BABYLON.Scene(engine); var light = new BABYLON.HemisphericLight("Hemi0", new BABYLON.Vector3(0, 1, 0), scene); light.diffuse = new BABYLON.Color3(1, 1, 1); light.intensity = 0.7; light.groundColor = new BABYLON.Color3(1, 1, 1); light.direction = new BABYLON.Vector3(0, -1, 0); var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, false); BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true; BABYLON.SceneLoader.ImportMesh("", caminho, arquivo, scene, function (newMeshes) { // caminho = way // arquivo = file var zeromat = new BABYLON.StandardMaterial("zeromat", scene); zeromat.emissiveTexture = new BABYLON.Texture("js/back2.jpg", scene); zeromat.wireframe = false; zeromat.backFaceCulling = true; newMeshes[0].material = zeromat; var meiomat = new BABYLON.StandardMaterial("meiomat", scene); meiomat.diffuseColor = new BABYLON.Color3(0.3,0.3,0.3); newMeshes[1].material = meiomat; camera.maxZ= 45000; camera.setPosition(new BABYLON.Vector3(7000,7000,7000)); camera.wheelPrecision = 0.1; }); // Move the light with the camera scene.registerBeforeRender(function () { }); return scene; } var scene = createScene(); // Register a render loop to repeatedly render the scene engine.runRenderLoop(function () { scene.render(); }); // Watch for browser/canvas resize events window.addEventListener("resize", function () { engine.resize(); }); } Sorry for my english, I'm using google translate
  6. The problem is that I can not apply a material or anything on my elements I simply apply a color and it does not work
  7. Hello, thanks for your reply but it is still not showing the color, I can notice that the color is under my mesh,
  8. How do I put my files in PG?
  9. I converted to ASCII with the site you recommended to me and is giving the same error, what can it be?
  10. Hello, I have a .obj and I'm trying to change the color of it with the material, but this color change works only when I take the .mtl file, what can it be? I noticed that I change the color below .obj // Get the canvas element from our HTML below var canvas = document.querySelector("#renderCanvas"); // Load the BABYLON 3D engine var engine = new BABYLON.Engine(canvas, false); // ------------------------------------------------------------- // Here begins a function that we will 'call' just after it's built var createScene = function () { var scene = new BABYLON.Scene(engine); //Adding a light var light = new BABYLON.HemisphericLight("Hemi0", new BABYLON.Vector3(0, 1, 0), scene); light.diffuse = new BABYLON.Color3(1, 1, 1); light.intensity = 0.8; light.groundColor = new BABYLON.Color3(1, 1, 1); light.direction = new BABYLON.Vector3(0, -1, 0); //Adding an Arc Rotate Camera var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, false); // The first parameter can be used to specify which mesh to import. Here we import all meshes BABYLON.SceneLoader.ImportMesh("", "js/novo/", "edifício sem texturaas.obj", scene, function (newMeshes) { BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true; var zeromat = new BABYLON.StandardMaterial("zeromat", scene); zeromat.diffuseColor = new BABYLON.Color3(1,1,1); zeromat.wireframe = false; zeromat.backFaceCulling = true; scene.meshes[0].material = zeromat; // var alltextura = new BABYLON.StandardMaterial("alltextura", scene); // alltextura.backFaceCulling = false; // scene.meshes.material = alltextura; var meiomat = new BABYLON.StandardMaterial("meiomat", scene); meiomat.diffuseColor = new BABYLON.Color3(0.2, 0.2, 0.2); scene.meshes[1].material = meiomat; // Set the target of the camera to the first imported mesh camera.setPosition(new BABYLON.Vector3(8000,8000,8000)); // camera.target = newMeshes[0]; camera.wheelPrecision = 0.1; camera.maxZ= 45000; }); // Move the light with the camera scene.registerBeforeRender(function () { }); return scene; } var scene = createScene(); // Register a render loop to repeatedly render the scene engine.runRenderLoop(function () { scene.render(); }); // Watch for browser/canvas resize events window.addEventListener("resize", function () { engine.resize(); }); edifício sem texturaas.obj edifício_sem_texturaas.mtl
  11. It's already an ASCII, am I right?
  12. These problems are only present in textures with images
  13. How do I see this? I'm new to this area.
  14. Hello, when I try to upload a file. Stl it gives me the following error : SyntaxError: Unexpected token E in JSON at position 0 // Get the canvas element from our HTML above var canvas = document.getElementById("renderCanvas"); // Load the BABYLON 3D engine var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("js/", "stlfilestl.stl", engine, function (newScene) { console.log("reklfjsklf"); var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), newScene); newScene.activeCamera.attachControl(canvas, false); engine.runRenderLoop(function () { newScene.render(); }); });
  15. Hello, I'm back! , I have a scene with a .obj, it loads right, but with some problems, look at the images and see that some parts are wrong And another part are the windows that were missing half