juanmajr93 Posted September 12, 2017 Share Posted September 12, 2017 Hi team, I would like to create a ground in my scene. However I don't want that it was square, is it possible? Thanks! Quote Link to comment Share on other sites More sharing options...
jerome Posted September 12, 2017 Share Posted September 12, 2017 http://doc.babylonjs.com/classes/3.0/meshbuilder#static-createground-name-options-scene-rarr-mesh-classes-3-0-mesh- options : height and width Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted September 12, 2017 Author Share Posted September 12, 2017 @jeromeYes, I knew these parameters but i have to create a ground like the follow polygon: Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 12, 2017 Share Posted September 12, 2017 you can then rely on csg to merge meshes. Here is an example: https://www.babylonjs.com/demos/csg/ and the code: https://github.com/BabylonJS/Website/tree/master/Demos/CSG Quote Link to comment Share on other sites More sharing options...
dbawel Posted September 12, 2017 Share Posted September 12, 2017 I would personally create the ground as a squre, and use a material/texture with an alpha channel to create any shape you wish to be rendered. I believe this would be far simple than what is currently being discussed; however, I'm not certain what the final use will be, and there may be a few rare cases where masking the geometry with an alpha channel for renderig may not produce the results you require - such as in the case of particle collisions. DB GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted September 16, 2017 Author Share Posted September 16, 2017 Hi @Deltakosh, @dbawel, @Wingnut, @jerome l have considered that create a ground like a irregular figure is imposible with BabylonJS. If I use a material or texture with an alpha channel, I don't get the results that I want. This material is applied to all parts of ground. Another question is relative to the creation of some information layers overlapping to the ground. My first idea was drawing a polygon whose points had the coordinates x and z (choosen by me) and y (defined by the height of ground). However, It does not work because de polygon is plane. Could you help me? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
JohnK Posted September 16, 2017 Share Posted September 16, 2017 This might be worth a try. Create a polygon matching the shape you want http://doc.babylonjs.com/tutorials/mesh_createxxx_methods_with_options_parameter#polygon Increase number of vertices within polygon by adding this function http://babylonjsguide.github.io/snippets/Increasing_Facets Use a heightmap image with low level fur material to change vertical height of vertices by using the customize the material including a heightexture. Away from PC for a week plus so cannot give a PG example. Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted September 16, 2017 Author Share Posted September 16, 2017 hi @JohnK I have set the polygon under the area that I have to cover. See it in the follow image. The follow goal is to define the heightmap of this polygon which must be the same to the ground. My final objective is to delimite different areas of the ground which represent an interesting feature of the terrain represented. Maybe another solution could be the representation of custom mesh where I could define each point and set them to the level of ground. Other solution could be an extrusion of polygon to the level of ground. Both can be developed? Quote Link to comment Share on other sites More sharing options...
dbawel Posted September 17, 2017 Share Posted September 17, 2017 @juanmajr93 Have you tried a normal map within a bumpTexture channel? Normal maps are simple to create in photoshop if you install a free plugin by NVidea. DB Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2017 Share Posted September 18, 2017 Extrusion is already supported. What could be great would be a repro in the playground of the current state of your experiment so we could all hack around Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 19, 2017 Share Posted September 19, 2017 Why not create the terrain directly with the blender editor or 3ds max and export it. So you can draw any shape you want. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 19, 2017 Share Posted September 19, 2017 Why not just use a square and an alpha texture? 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.