• Content Count

  • Joined

  • Last visited

About eucly2

  • Rank
    Advanced Member
  • Birthday 01/18/1988

Profile Information

  • Gender
  • Location
    Figeac (France)
  1. You are amazing!!! All work perfectly (I can die in peace now ) Thank you so much for this
  2. Ok it's work, positions, normals and uvs are good, but there is one curious problem. When i change the scale of a new mesh, the scale is good but it move too. You can see the problem on my joins file or on this PG :
  3. Hi! Thanks for your answer. That is exactly what i want to do: It's work on the PG so I hope it will work on my project, I try tomorrow on it and I will tell you the result. Thanks DK and JohnK.
  4. Sorry but it doesn't work. With your code, for example, if the size of my indices array is 132 the for loop put 132 values in the positions array instead of 396 (132 x 3)
  5. Hey everyone! I'm trying to extract VerticeData from a SubMesh to create an other mesh but i always failed. I want to extract indices, positions, normals and uvs for the moment: Indices: var result = new VertexData(); var indices = subMesh.getMesh().getIndices(); for (var index = subMesh.indexStart; index < subMesh.indexStart + subMesh.indexCount; index++) { result.indices.push(indices[index]); } Positions and normals: var positions = subMesh.getMesh().getVerticesData(BABYLON.VertexBuffer.PositionKind, copyWhenShared); var vertex; for (var index = subMesh.indexStart; index < subMesh.indexStart + subMesh.indexCount; index+=3) { vertex = new BABYLON.Vector3.TransformCoordinates(new BABYLON.Vector3(positions[index], positions[index + 1], positions[index + 2]), worldMatrix); result.positions.push(vertex.x); result.positions.push(vertex.y); result.positions.push(vertex.z); } Anyone to help me?
  6. Set the position of the probes, why not... But if meshes are in the box, the reflection render all the meshes : Maybe adding scaling properties on probe will be better...
  7. Thanks a lot for this Deltakosh, that is just wooow !! I have questions about that: Why reflections on geometry like a box are so big and not on sphere? So is it possible to reduce the reflection? For marble texture it's very awsome...
  8. Done! I make a pull request on arcRotateCamera. Can you take a look?
  9. I up this topic because I'm very interested in it too. hand.js can help for this, no?
  10. I think in BabylonJS the shadows generator use dynamics shadows and that is expensive but in the scene "The train" the shadows are include in the textures (painting when they have create the scene in 3dsMax for example). That why is an optimized scene.
  11. I think we need a new type of camera for translation and with it we can switch to another camera typed of translation when rightmousedown event fired...
  12. Hi! I make a web page with your file. In this page you can change texture and color of all your meshes in your babylon file: <!DOCTYPE html><html xmlns=""> <head> <title>Using babylon.js - How to load a scene</title> <script src="babylon.js"></script> <style> html, body { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden; } #renderCanvas { width: 100%; height: 100%; } </style> </head> <body> <select onchange='changeColor(this.value);'> <option value='0'>Red</option> <option value='1'>Blue</option> <option value='2'>Green</option> </select> <select onchange='changeTexture(this.value);'> <option value='texture/texture1.jpg'>texture1</option> <option value='texture/texture2.jpg'>texture2</option> <option value='texture/texture3.jpg'>texture3</option> </select> <script> function changeTexture(texture) { var allMeshChange = false; var i = 0; while (!allMeshChange) { if (scene.meshes[i].material.diffuseTexture) scene.meshes[i].material.diffuseTexture.dispose(); scene.meshes[i].material.diffuseTexture = new BABYLON.Texture(texture, scene); allMeshChange = i == scene.meshes.length - 1; i++; } } function changeColor(number) { var allMeshChange = false; var i = 0; var color; switch (number) { case '0':// Red color = new BABYLON.Color3(1, 0, 0); break; case '1':// Blue color = new BABYLON.Color3(0, 0, 1); break; case '2':// Green color = new BABYLON.Color3(0, 1, 0); break; case '3':// Purple color = new BABYLON.Color3(1, 0, 1); break; } while (!allMeshChange) { scene.meshes[i].material.diffuseColor = color; allMeshChange = i == scene.meshes.length - 1; i++; } } </script> <canvas id="renderCanvas"></canvas> <script> var scene; if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "test2.babylon", engine, function(newScene) { newScene.executeWhenReady(function() { newScene.activeCamera.attachControl(canvas); scene = newScene; engine.runRenderLoop(function() { newScene.render(); }); }); }, function(progress) { }); } </script> </body></html>And your textures are in a folder named "texture" I can't do anything else I hope it's will be good for you.