Dad72 Posted November 26, 2013 Share Posted November 26, 2013 Hi, I would like to create a grid to mark the level of the sea in the world. is this that there is a function in Babylon which allows you to create a grid?Grid example:http://blackjk3.github.io/threefab/ How can I do? Thanks Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 26, 2013 Share Posted November 26, 2013 Hello, You can create a plan with some subdivisions, and set its material to wireframe. It should do the trick Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 26, 2013 Author Share Posted November 26, 2013 Thanks Temechon. I had thought to do as this.What is the code for subdivide? I see the subdivisions with CreateGroundFromHeightMap, but not on BABYLON.Mesh.CreatePlane Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 26, 2013 Share Posted November 26, 2013 Use the function CreateGround : BABYLON.Mesh.CreateGround = function (name, width, height, subdivisions, scene, updatable) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 26, 2013 Author Share Posted November 26, 2013 Thanks I made :var grid = BABYLON.Mesh.CreateGround("Grid", 400, 400, 25, scene, false);var materialGrid = new BABYLON.StandardMaterial("textureGrid", scene);materialGrid.wireframe = true;grid.material = materialGrid; Quote Link to comment Share on other sites More sharing options...
melaugui Posted December 4, 2013 Share Posted December 4, 2013 Hi, To complete this question, if you want to customize your grid, I have made something similar in another way for my game (http://tronbabylon.azurewebsites.net/)The mesh is only a big single plane (BABYLON.Mesh.CreatePlane), but with a square alpha material which is repeated with uScale/vScale properties, like this : (black could be transparent for your need) once repeated, you've got your grid Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 4, 2013 Author Share Posted December 4, 2013 Thank you. But with BABYLON.Mesh.CreateGround. I have a grid.Your solution can also work, rest has know the something consumes less CreatePlane or CreateGround.CreateGround has no texture to load, it seems to me to be a better option. But I would try your solution later to make a comparison. Quote Link to comment Share on other sites More sharing options...
melaugui Posted December 4, 2013 Share Posted December 4, 2013 Agree, Temechon "CreateGround" solution should be better for GPU usage (no texture), but I'm not sure how to customize wireframe grid, if needed...And compararison should be interesting 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.