Repeat Wrapping

Demonstrates Wrapping.Repeat with adjustable UV tiling.

Controls

Repeat U

1
5

Repeat V

1
5
import * as EASEL from "easel";

const tex = new EASEL.DataTexture(data, 16, 16);
tex.wrapS = EASEL.Wrapping.Repeat;
tex.wrapT = EASEL.Wrapping.Repeat;

const material = new EASEL.LambertMaterial({ color: 0xffffff });
material.map = tex;

const plane = new EASEL.PlaneGeometry(4, 4);
const uv = plane.getAttribute("uv");
for (let i = 0; i < uv.array.length; i += 2) {
  uv.array[i] *= 3;
  uv.array[i+1] *= 3;
}

const mesh = new EASEL.Mesh(plane, material);
scene.add(mesh);