carringtonW84

Members
  • Content Count

    14
  • Joined

  • Last visited

About carringtonW84

  • Rank
    Member

Contact Methods

  • Twitter
    @jeremycourbet
  1. alpha version : http://babylonjs-map.azurewebsites.net/
  2. Thank you very much ! It works however the polygon mesh with triangulation and the extruded mesh with extrusion haven't the same reference. I had to make a rotation and invert a coordinate (to make a mirror effect). See in attachment. Thanks again for your help !
  3. Thank you but I didn't understand everything, can you explain please ?
  4. Thanks ! It works ... But from a particular resolution, I have black vertex that appears
  5. Hello, thank you for your help ! For information I managed to do that : a filled polygon but not extruded because the method "ExtrudeShape" requires a array of Vector3, not a mesh. a Vector3 array extruded but nor filled Have you any idea please ? Thank you ! var createScene = function () { var scene = new BABYLON.Scene(engine); var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(-15, 8, -30), scene); camera.attachControl(canvas, true); var light = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene); //filled polygon not extruded var poly2 = BABYLON.Polygon.Parse("12 10 12 8 14 7 16 8 16 10"); var pmb2 = new BABYLON.PolygonMeshBuilder("poly2", poly2, scene).build(); //Vector3 array extruded but not filled var v3SVG = Vector3FromPath($("#path3344").get(0),240); var path = [ BABYLON.Vector3.Zero(), new BABYLON.Vector3(0, 1, 0)]; var extruded = BABYLON.Mesh.ExtrudeShape("extruded", v3SVG, path, 1, 0, 0, scene); return scene; } function Vector3FromPath(path,samples) { var arrayVector3 = new Array(); var len = path.getTotalLength(); var step = step=len/samples; for (var i=0;i<=len;i+=step) { var p = path.getPointAtLength(i); var unitVector3 = new BABYLON.Vector3(p.x/10, p.y/10, 0); arrayVector3.push(unitVector3); } return arrayVector3; }
  6. Bonjour, je souhaite faire une Terre en 3D pour visualiser des données propres aux pays, quelque chose qui ressemble à ça : http://visualiser.fr/Babylon/cloud/index.html Je pense avoir (quasiment) tous les élements pour le faire : - BabylonJS - Poly2Tri.js - PEP.js - la carte du monde en SVG : https://upload.wikimedia.org/wikipedia/commons/0/03/BlankMap-World6.svg Le seul point qui me manque est : comment construire ma / mon mesh (correspondant à un pays) à partir d'un path SVG ? Est-ce possible ? Extrait du SVG : <g id="mv"> <title>Maldives</title> <path class="landxx coastxx mv" d="M 1785.0883,736.35884 C 1785.1683,735.65884 1784.8993,734.78584 1784.0083,734.98884 1784.5423,735.26884 1784.9613,735.76284 1785.0883,736.35884" id="mv-"/> <circle class="circlexx mv" cx="1784.2205" cy="730.37396" id="mv." r="6.0130301"/> </g> Merci d'avance pour votre aide !
  7. Thanks, it's ok now assetsManager.onFinish = function (tasks) { while(!textureStars.isReady()) setTimeout(function() { }, 50); engine.runRenderLoop(function () { scene.render(); }); };
  8. Hello, I would like to use the assetsManager to load asynchronously a BABYLON.CubeTexture, is it possible ? Thank you for your responses ! Jérémy
  9. Yes exactly, just for fun...
  10. Thanks Luaacro ! But the mathematics aren't my problem... I was initially turn the two wheels but it's not a real gear BABYLON.SceneLoader.ImportMesh("", "scenes/", "wheel4.babylon", scene, function (newMeshes) { camera.target = newMeshes[0]; wheel1 = newMeshes[0]; wheel1.position = new BABYLON.Vector3(0, 0, 0); wheel1.material = materialRed; //wheel1.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, {mass:0, friction:0.5, restitution: 4}); wheel2 = wheel1.clone("wheel2"); wheel2.position = new BABYLON.Vector3(5.3, 0, 0); wheel2.material = materialBlack; //wheel2.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, {mass:0, friction:0.5, restitution: 4}); scene.registerBeforeRender(function () { wheel1.rotate(new BABYLON.Vector3(0, 1, 0) , 0.01, BABYLON.Space.LOCAL); //wheel2.rotate(new BABYLON.Vector3(0, 1, 0) , -0.01, BABYLON.Space.LOCAL); });});If you run my project, you will see that the red wheel crosses the black wheel so now I want: - That the two wheels are "solid" (do not cross) - Add a constraint on the Y axis to the black wheel Thus the black wheel will turn because of the red wheel. Below the link to download my project : http://1drv.ms/1AzSZpX Thank you !
  11. Hi, I was wrong, can you move this topic http://www.html5gamedevs.com/topic/10907-simulate-a-gear/ in the forum "BabylonJS." Thank you !
  12. Hi, I'm still thinking about my problem: - I drew a wheel with Blender - I imported and duplicated this wheel with BabylonJS Now the black wheel turns as you can see below: http://www.hostingpics.net/viewer.php?id=49727049ss.png But I miss two things: - Add a constraint on the Y axis of the red wheel - That the two wheels do not cross. Someone to help me ?Thanks a lot !
  13. carringtonW84

    Simulate a gear

    Hi ! I'm starting with BabylonJS: for information I know simulate the solar system and simulate a bouncing ball in a closed room. Now I would like to simulate a simple gear with two wheels but I do not know where to start ... Could you give me the method to make this simulation and what features should be used? Thank you in advance and good evening