desMaker

Members
  • Content Count

    5
  • Joined

  • Last visited

About desMaker

  • Rank
    Newbie

Recent Profile Visitors

500 profile views
  1. Thanks, it was exactly what I was looking for! Here is my code: var inputElement = document.getElementById("input"); inputElement.addEventListener("change", function handleFiles(event) { var fileList = this.files[0]; var reader = new FileReader(); reader.addEventListener("loadend", function () { var data = reader.result; // The first parameter can be used to specify which mesh to import. Here we import all meshes BABYLON.SceneLoader.ImportMesh("", "", "data:" + data, scene, function (newMeshes) { }); }); reader.readAsText(fileList); }, false);
  2. Hello, i want to import a File with the BABYLON.SceneLoader.ImportMesh, but i don't have a URL, because the file comes form a Form. i have input form: <html> ... <input type="file" id="upload_file" name="upload" /> ... </html> and i try to import my Mesh (.babylon-File) out of the form, without uploading it. But i don't know how to import a file without a given URL. Please Help me :-) <script>... var inputElement = document.getElementById("upload_file"); inputElement.addEventListener("change", function handleFiles(event) { var fileList = this.files[0]; // The first parameter can be used to specify which mesh to import. Here we import all meshes BABYLON.SceneLoader.ImportMesh("", "", "data:" + fileList, scene, function (newMeshes) { // Set the target of the camera to the first imported mesh camera.target = newMeshes[0]; }); }, false); ... </scrip> Thanks!
  3. Thanks for watching. I found the method 'onCollision()', so i'll try to solve my problem with this method.
  4. Hi, try this one: var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 500, 1), scene); camera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA; camera.orthoTop = 500; camera.orthoBottom = -500; camera.orthoLeft = -500; camera.orthoRight = 500; var ratio = window.innerWidth / window.innerHeight ; var zoom = camera.orthoTop; var newWidth = zoom * ratio; camera.orthoLeft = -Math.abs(newWidth); camera.orthoRight = newWidth; camera.orthoBottom = -Math.abs(zoom); camera.setTarget(new BABYLON.Vector3.Zero()); scene.activeCamera = camera;
  5. Hello, is it possible to use mesh.actionManager.registerAction(new BABYLON.SetValueAction({ trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: otherMesh }, mesh, "scaling", new BABYLON.Vector3(1.2, 1.2, 1.2))); http://http://doc.babylonjs.com/tutorials/How_to_use_Actions without defining the 'otherMesh' at the beginning.So that i get the 'otherMesh' as an object when the trigger fires/ on Intersection? Thanks!