This texture draws a grid trying to maintain fixed width of grid lines. Click on a snapshot to open it online.
Code template of parameters with their default values.
import * as PET from "pet/patterns/grid.js";
:
model.material.map = PET.texture( );
PET.material( model.material );
The parameters of the texture generator are:
width
– texture width in pixels, default 512height
– texture height in pixels, default 256countH
– number of horizontal grid cells [2,100], default 32countV
– number of vertical grid cells [2,100], default 16thickness
– thickness of grid lines [1,100], default 32caps
– whether to draw caps near the poles [true,false], default truecolor
– color of lines, default 0x000000 (black)background
– color of background, default 0xFFFFFF (white)All texture modules share the same API.
pattern( x, y, z, color, options, u, v )
– pattern implementationtexture( {params} )
– generator for a texture with given parametersdefaults
– object with default parametersmaterial( ... )
– material shader patcher