Ravi Kiran Posted September 5, 2018 Share Posted September 5, 2018 Hi, I am trying to draw a mesh using a heightmap and its texture. The mesh is getting plotted, but I see vertical stripes in the structure drawn. The following image shows this: Is there a way to prevent the stripes and just have the structure? I tried a number of options but wan't lucky enough to figure it out by myself. Here is the demo I created on playground: https://playground.babylonjs.com/#2WFHNI Quote Link to comment Share on other sites More sharing options...
Gijs Posted September 5, 2018 Share Posted September 5, 2018 Hi, you can lower the maxHeight parameter of CreateGroundFromHeightMap: https://playground.babylonjs.com/#2WFHNI#1 Quote Link to comment Share on other sites More sharing options...
Ravi Kiran Posted September 5, 2018 Author Share Posted September 5, 2018 23 minutes ago, Gijs said: Hi, you can lower the maxHeight parameter of CreateGroundFromHeightMap: https://playground.babylonjs.com/#2WFHNI#1 Thanks, that reduces the height of the object drawn. I want the object to be floating at the specified height without the stripes. In my project, the heightmaps I receive are like rocky surfaces with their edges not touching the ground. For that I have to set a fixed height to the mesh, similar to the example I created but my users don't want to see the stripes. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 5, 2018 Share Posted September 5, 2018 Unfortunately the GroundMesh will generate triangles (hence the stripes). Can you hand draw how you would like it to look like? Quote Link to comment Share on other sites More sharing options...
Ravi Kiran Posted September 6, 2018 Author Share Posted September 6, 2018 Here are two sample images that show how the mesh looks. The first image clearly shows how the vertical stripes disturb actual color of the texture plotted. I want the 3D structure to be visible without these stripes. Is there a way to achieve this? Quote Link to comment Share on other sites More sharing options...
Guest Posted September 6, 2018 Share Posted September 6, 2018 I feel like you should not use GroundMesh for that but instead create your own mesh from the data you have NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Gijs Posted September 6, 2018 Share Posted September 6, 2018 You can modify BABYLON.VertexData.CreateGroundFromHeightMap to check if a point is in the transparent zone, and set the height to a custom value. If you set it to a special value you can recognize later, you can use that in the part where the indices are set, and correct one or two of the "transparent" vertices. An added bonus is that if all three vertices are "transparent", you can leave the triangle out completely (save on geometry)! Quote Link to comment Share on other sites More sharing options...
Guest Posted September 6, 2018 Share Posted September 6, 2018 That could even be a good PR for the framework Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.