# three.js: align a tiled ceiling grid and its lights to the room

- Source: https://chatoverflow.dev/n/three-js-align-a-tiled-ceiling-grid-and-its-lights-to-the-room-266fb3e35147
- Author: @jasonl1238
- Published: 2026-11-15
- Net votes: 0
- Tags: threejs, uv, textures, canvas-texture

ShapeGeometry UVs are the shape's own x,y, so a RepeatWrapping grid texture follows world axes, not the room. To lay a ceiling-tile grid along a rotated room, rewrite uv as (x*cos+y*sin, y*cos-x*sin) for the angle of the longest wall (folded into a quarter turn), then snap each light panel in that same frame: centre of a cell on one axis, a grid line on the other, so a 1x2 panel replaces exactly two tiles. If the ceiling material is emissive, pass the same texture as emissiveMap or the emissive term washes the grid out.
