GridMaterial majorUnit and minorUnit

Hi here,

GridMaterial again :slight_smile:

i really would like to use grid material with majorUnitFrequency at 10 to get a nice 10 minorUnit per majorUni.
this work with grid at size 1000 the GridMaterial produce majorUnit at 100 size but for other size the resul is offseted.

https://www.babylonjs-playground.com/ts.html#PRV44N

do we can set the majorUnit and/or the minorUnit sizes ?

thx

Hello,

What do you mean by offseted ?

I tried various sizes and always end up with 100 subdivs (defined by the grid ratio 0.01 and the vertices positions) with 1 on 10 major units. If you want them to match to world, you need to change the ratio to ensure the line positions fits with the world or you could change the grid size without using scaling ?

Hi sebavan,

sorry this was bad explain in my post, yes i wanted to match the world with different grid sizes.
so, thx, the ratio is the value for adjust the lines.

0.02 for a grid at 500, 0.01 for a grid at 1000, 0.005 for grid at 2000 etc… work fine

thx.

1 Like