Sme

Members
  • Content Count

    7
  • Joined

  • Last visited

  1. Thanks for the tips. After trying to 'overlap' the edges of each chunk, I too had an issue with shading, particularly areas where the slope was steep. After some fiddling around, I managed to find another solution. What I did was created another canvas element on the document, as well as an image element to store the entire height map. Then I draw the image onto the canvas, based on which part of the map needs to be loaded https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage (the canvas' context's API makes this very easy). Once the image is drawn on the canvas, I create the height map using canvas.toDataUrl(), instead of the original heightmap .png URL. Also, this means I only have one ground mesh, instead of 25. I still don't have code for loading new sections of the map (ie, re-drawing he image on the canvas with the new offset coordinates, then re-creating the ground mesh with the new dataURL.) This shouldn't take too long, once I finish I will test and see how the performance is. (hopefully it is a smooth transition! Perhaps someone who understands babylonJS more than I will already know if this is a good solution or not)
  2. I have a rather large map, and am therefore loading it in chunks 16x16 units in size. At any given time, there are are a total of 25 chunks loaded in a 5x5 grid. Each chunk has its own mesh, created using BABYLON.Mesh.createGroundFromHeightMap, and then I position the ground meshes at the appropriate locations. To create the height maps, I took the original map and cut it into chunks as well, and then pass it to each chunk. However, the edges of the ground meshes do not align, particularly if the edge has a steep slope. I attached a screenshot to better understand what I'm talking about. Whats the best way to fix this? Is using 25 ground meshes at a time a bad idea (should I only have 1 ground mesh at any given time)? Thanks
  3. Is there a way to suppress the warnings when compiling, for example, As far as I'm aware, I don't need to use any functionality cannon, earcut, or oimo (i'm getting warnings for all 3). If it matters, I'm using VSCode, TypeScript, and webpack-dev-server for my development environment. Thanks
  4. RIght, and actually the issue was with my code, and not with the call to getHeightAtCoordinates. Nonetheless thanks for the quick response Edit: Sorry, I can't get the PlayGround to load right now, so I can't check out the source code (I'm in China so my internet isn't the quickest at times)
  5. Awesome, it works great, thanks!
  6. I'm new to BJS, so I apologize if this is such a basic question. I have created a ground with a heightmap, and I am simply wondering how can I make sure all entities remain on the ground? Note that there is no physics in my game, so no jumping, etc. In other words, entities will always be 'stuck' to the ground. Right now when creating entities, I am using Vector3 and setting their Y value, but since I am using a heightmap this Y value obviously needs to be dynamic, depending on its current location on the ground. I was looking here at this link https://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity , it seems like I can achieve this by setting the scene's gravity, and setting ground.checkCollisions = true. Considering my use case here is very basic (no physics, entites stuck to ground, etc.), is this still the proper way to handle this scenario? Thanks
  7. Sme

    ArcRotateCamera rotation speed

    Sorry to bump an older topic, but I too am unable to change (lower) the speed of the ArcRotateCamera. Setting the speed property doesn't seem to have any effect