wind

Members
  • Content Count

    14
  • Joined

  • Last visited

About wind

  • Rank
    Member

Recent Profile Visitors

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

  1. I have moved the code in the script tags in the index.html file to a separate JS file, but still no code hinting. I think I just have to get used to it. Thanks.
  2. Yes, it's strange, because on the Welcome page, under the Customize > Tools and Languages section, there is a pop-up message that states that TypeScript support is already installed (if we hover our mouse over "Install support for TypeScript").
  3. There is no "File > New Project" in VSCode, unlike some IDEs. I think the VSCode is the latest version (1.15.1). I just edit the "index.html" directly from my WAMPServer's www folder ("C:\wamp\www\The_Folder"). I tried to put the babylonjs d.ts into that folder, but there is no effect. Did I miss something in the VSCode's installation?
  4. I use JS, because JS are used on the official tutorials and examples. Where can I find the babylonjs d.ts file? Sorry if I sounded like a noob, because actually I'm not a programmer and I'm used to other IDE's easy installation.
  5. @Hersir : I just realized that the default code hinting feature in VSCode is not good. For example, if I type "var scene = new BABYLON.", I will not get a list of BABYLON class' properties and methods after the dot(.). Is there a way to make the code hinting feature better?
  6. Thanks. I tried to enable the offline support for the engine, but I still cannot export my editing result with the offline visual editor. I think Babylon.js could be more popular if there is a good offline visual editor like what Unity has. Visual Studio is too heavy for my device. But VSCode is excellent, as what @Hersir suggested.
  7. Currently I am using Notepad++ to practice with Babylon.js, but there is no code hint like what Unity's MonoDevelop has. What Babylon.js' IDE should I use to get the code hints? The online visual editor (editor.babylonjs.com) works, but I need an offline visual editor, because I will go to a place with very weak internet connection. I tried the offline visual editor (github.com/BabylonJS/Editor), but it does not work like the online version. Is there other offline visual editor I can use?
  8. Hi, apparently the textures didn't appear because I used wrong .htaccess... Now I can see the textures. There is another problem, the mesh looks hard (please see the attached picture). It is not like this in 3ds Max. Is there any method in Babylon JS to soften the mesh?
  9. @Deltakosh : Thanks, it works... I can see the model, but I cannot see the textures, even though I have collected the textures in the same folder. I have tried to assign a texture to all models, but I still cannot see the texture. Here is my code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Babylon - Basic scene</title> <style> html, body { overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0; } #renderCanvas { width: 100%; height: 100%; touch-action: none; } </style> <script src="babylon.js"></script> <script src="hand.js"></script> <script src="cannon.js"></script> <!-- optional physics engine --> <script src="oimo.js"></script> <script src="babylon.objFileLoader.js"></script> </head> <body> <canvas id="renderCanvas"></canvas> <script> // 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); // This begins the creation of a function that we will 'call' just after it's built var createScene = function () { // This creates a basic Babylon Scene object (non-mesh) var scene = new BABYLON.Scene(engine); var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 10, 0), scene); light.intensity = 1; var cam = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0, 5, new BABYLON.Vector3(0, 3, 0), scene); cam.attachControl(canvas); var loader = new BABYLON.AssetsManager(scene); var position = -5; var pos = function(t) { t.loadedMeshes.forEach(function(m) { //m.position.x -= position; m.position = new BABYLON.Vector3(0, 0, 0); m.material = new BABYLON.StandardMaterial("mat", scene); m.material.diffuseTexture = new BABYLON.Texture("/assets/Control_Panel.jpg", scene); }); position += 5; }; //var bane = loader.addMeshTask("bane", "", "https://dl.dropboxusercontent.com/u/17799537/objFileLoader/Bane/", "Bane_3.obj"); //var bane = loader.addMeshTask("bane", "", "http://bayu.net23.net/objFileLoader/", "Bane_3.obj"); var bane = loader.addMeshTask("bane", "", "assets/", "TestMultipleObjects.obj"); //var bane = loader.addMeshTask("bane", "", "http://bayu.net23.net/objFileLoader/", "TestMultipleObjects.obj"); bane.onSuccess = pos; loader.onFinish = function() { engine.runRenderLoop(function () { scene.render(); }); }; loader.load(); return scene; }; // End of createScene function // Now, call the createScene function that you just finished creating 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(); }); </script> </body> </html> Do you know how to show the textures?
  10. @Temechon : I uploaded the asset ("Bane_3.obj") to other web server (e.g. http://bayu.net23.net) and cannot load it. If I load the asset from the DropBox, with the code below, it will work: var bane = loader.addMeshTask("bane", "", "https://dl.dropboxusercontent.com/u/17799537/objFileLoader/Bane/", "Bane_3.obj"); But if I load the asset from the other web server (e.g. http://bayu.net23.net), with the code below, it doesn't work: var bane = loader.addMeshTask("bane", "", "http://bayu.net23.net/objFileLoader/", "Bane_3.obj"); The whole code is below (I got it from your demo (http://www.babylonjs-playground.com/#28YUR5) ) : <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Babylon - Basic scene</title> <style> html, body { overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0; } #renderCanvas { width: 100%; height: 100%; touch-action: none; } </style> <script src="babylon.js"></script> <script src="hand.js"></script> <script src="cannon.js"></script> <!-- optional physics engine --> <script src="oimo.js"></script> <script src="babylon.objFileLoader.js"></script> </head> <body> <canvas id="renderCanvas"></canvas> <script> // 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); // This begins the creation of a function that we will 'call' just after it's built var createScene = function () { // This creates a basic Babylon Scene object (non-mesh) var scene = new BABYLON.Scene(engine); new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 10, 0), scene); var cam = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0, 5, new BABYLON.Vector3(0, 3, 0), scene); cam.attachControl(canvas); var loader = new BABYLON.AssetsManager(scene); var position = -5; var pos = function(t) { t.loadedMeshes.forEach(function(m) { m.position.x -= position; }); position += 5; }; //var bane = loader.addMeshTask("bane", "", "https://dl.dropboxusercontent.com/u/17799537/objFileLoader/Bane/", "Bane_3.obj"); var bane = loader.addMeshTask("bane", "", "http://bayu.net23.net/objFileLoader/", "Bane_3.obj"); bane.onSuccess = pos; loader.onFinish = function() { engine.runRenderLoop(function () { scene.render(); }); }; loader.load(); return scene; }; // End of createScene function // Now, call the createScene function that you just finished creating 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(); }); </script> </body> </html> How to load an OBJ file from a web server correctly?
  11. I follow a Microsoft tutorial to show a scene that I exported from 3ds Max. The tutorial link is: https://blogs.msdn.microsoft.com/eternalcoding/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender/ The Babylon scene can be seen on the Sandbox, but not offline. Here is my page code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Using babylon.js - How to load a scene</title> <script src="babylon.js"></script> <script src="hand.js"></script> <script src="cannon.js"></script> <!-- optional physics engine --> <script src="oimo.js"></script> <style> html, body { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden; } #renderCanvas { width: 100%; height: 100%; } </style> </head> <body> <canvas id="renderCanvas"></canvas> <script> if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "TestExportFrom3dsMax.babylon", engine, function (newScene) { // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { // Attach camera to canvas inputs newScene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { newScene.render(); }); }); }, function (progress) { // To do: give progress feedback to user }); } </script> </body> </html> How to show the Babylon scene on web browser offline?