// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Touch-sampled staggered brick mortar // Not compiled or tested in-world // Setup: Put in a spare ordinary cube you own. Touch different places on one face to sample the procedural pattern at live surface coordinates. Edit the constants to design a pattern. // Stop / restore: Disable/remove. Only private owner messages are produced; no texture or tint is applied. // Notes: Mortar width is expressed as a fraction of each cell, so horizontal and vertical physical widths differ if cells differ in aspect. Surface coordinates depend on the viewer and mesh; ordinary prim faces are the clearest test surface. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Live surface-coordinate sampler. float COLUMNS=4.0; float ROWS=6.0; float MORTAR=0.08; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; vector uv=llDetectedTouchST(0); if(llDetectedTouchFace(0)<0||uv==TOUCH_INVALID_TEXCOORD) { llOwnerSay("Surface coordinates unavailable."); return; } vector p=2.0*uv-<1.0,1.0,0.0>; if(COLUMNS<=0.0||ROWS<=0.0||MORTAR<0.0||MORTAR>=0.5) { llOwnerSay("Invalid brick settings."); return; } float y=uv.y*ROWS; integer row=llFloor(y); float x=uv.x*COLUMNS; if(row&1)x+=0.5; x-=llFloor(x); y-=llFloor(y); integer mortar=(x1.0-MORTAR||y1.0-MORTAR); llOwnerSay("Row="+(string)row+" mortar="+(string)mortar); } }