Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Hello, Aie, I just find out my problem, trying to apply what you advised. My Ray origin was not positionned correctly .... Everything is ok, scene.pickWithRay is greaaaatttt !!!! Regards. Guillaume.
  2. Hello, I'm loading my scene from Blender, containing a simple plane (acting as ground), a camera and a light. I put a sphere (diam 1) on my ground and a ray with origin the center of the sphere and the vector direction (0,-1,0) When I move the sphere on this ground (say on the z axis only for example) , I check the altitude of the ground with scene.pickWithRay using the predicate to exclude my sphere. This works. But, when my sphere comes at the middle of the ground(for example), I clone this ground, change its id and set its position (z axis) at the end of the last ground (to fake an "
  3. ok ResonantCraft, this sounds clear, thank you !
  4. Ok, thanks for your response. And if we consider a section (the part of the track, items to collect, baddies etc ...), can you explain briefly how they connect 2 sections together. - If the character C is "running" on section A, when section B is added ? - if the character C is on section A, is it C which moves or section A (and all items composed on section A) ? I'm not sur to be clear but cannot formulate another way .... ;o((
  5. Hello, I got surely a dummy question and I apologize for that ... but, I wonder how people make endless running game like for example the minion game or jetpack joyride. Taking as example the minion game (image joined), does the character really advance or is it the objects around him which moves, or the textures mapped to the object which change. if this is the case, how to repeat indinitely the ground, for example ...
  6. Ah, too bad, so i guess i need to do that with blender...
  7. Hello, I have a question, I'd like te represent a winding road and either side, there will be empty space ... Would it be possible to do this with a heightmap, and if so, how to make the empty space ???
  8. Ok, thanks for the information Temechon, I did it , apparently it seems to work when I don't touch to the y value of the scaling property See, code 1 (with result screenshot 1) - do what I expected (mesh become red when I pass under) BABYLON.SceneLoader.ImportMesh("Cube", "Scenes/Wall/", "Wall.babylon", scene, function (newMeshes, particleSystems, skeletons) { var wallMesh = newMeshes[0]; wallMesh.scaling.z = 2; wallMesh.scaling.x = 10; wallMesh.computeWorldMatrix(); wallMesh.refreshBoundingInfo(); that.Walls.push(wallMesh);
  9. I did this: BABYLON.SceneLoader.ImportMesh("Cube", "Scenes/Wall/", "Wall.babylon", scene, function (newMeshes, particleSystems, skeletons) { var wallMesh = newMeshes[0]; wallMesh.scaling.x = 5; //Removing the scaling makes it work wallMesh.position.z = 40; wallMesh.position.x = 20; wallMesh.computeWorldMatrix(); that.Walls.push(wallMesh);});  I noticed that when I remove the scaling, it works ... What Am I doing wrong again ...
  10. Aie, just need some more help. In the example mentionned below, I used full built-in mesh from BABYLON.js, the box. This is ok, when I express the ray position in the mesh world, it works fine. Now I import a mesh from Blender, And try the same way to detect collisions with the Ray. But it is not working. After I express the ray in the "blender mesh" world, my ray got the direction u(0,-0.4,0), which I don't understand (express in the "global world", my ray direction is(0,-1,0)). I read that mesh from blender are y/z inverted compared to babylon.js I feel this has something to do with my pro
  11. It works !!! thanks a lot ! for (var i = 0; i < that.SceneManager.Walls.length; i++) { var inv = BABYLON.Matrix.Identity(); that.SceneManager.Walls[i]._worldMatrix.invertToRef(inv); that.GroundRay = BABYLON.Ray.Transform(that.GroundRay, inv); var distanceFromWall = that.SceneManager.Walls[i].intersects(that.GroundRay); if(distanceFromWall.hit === true) { that.SceneManager.Walls[i].material = that.SceneManager.MaterialManager.GetRedMaterial(); } else { that.S
  12. I make a precision: to check the collision, I use the BABYLON.Mesh.prototype.intersects(ray, fastcheck) function var distanceFromWall = Walls[i].intersects(ray, true);It seems that the property Walls.getBoundingInfo().boundingBox.minimum.z still persists to -5 value. Is it possible to have more infos about boundingBox.minimum/maximum property and minimumWorld/maximumWorld property ? One last question, when I change the position value of a mesh like mesh.position = new BABYLON.Vector3(x,y,z), I actually change its position in the world, isn't it ? Thanks for your answers !
  13. Hello, I have a simple blue box that I put in my scene and set the position this way: var box = BABYLON.Mesh.CreateBox("wall1", 10, that.Scene, false); box.position.z = 10; box.material = that.MaterialManager.GetBlueMaterial();I also have a character (the dude ...) on the scene and a BABYLON.Ray object which has: - for origin: the head of my character - for direction: BABYLON.vector3(0,-1,0). I want to check collision between my box and the Ray. When the dude collides with the box, the box appears red. Actually, the ray find a collision when the dude is between the (0
  • Create New...