Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 6.2 — UV Wrapping, Repeat and Offset
3D Web · Example 1 of 2

Three wrap modes, same picture

The "F" shows what happens. Clamp: one small F and a smear of edge pixels. Repeat: four copies. Mirrored: copies flipped like a book.

UV coordinates say which point of the picture lands on which point of the shape. wrapS, wrapT, repeat, offset, rotation and center decide what happens outside 0 to 1 and how the picture is stretched, tiled and moved.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 4 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

A 4 m × 4 m floor uses a tile that should cover 0.5 m. Write the three lines that tile it.

02

How do you make a tyre's tread appear to roll at 1 turn per second, without turning the mesh?

Explain it without notes

01

A floor texture shows one small picture and then a smear. What two things are missing?

02

Why does the rotation example need center.set(0.5, 0.5)?

Three wrap modes, same picture
Press Run to see the page.
idle

Console

Nothing logged yet.

Expected console output

ClampToEdgeWrapping (default)  | wrapS: 1001 | repeat: 2, 2
RepeatWrapping                 | wrapS: 1000 | repeat: 2, 2
MirroredRepeatWrapping         | wrapS: 1002 | repeat: 2, 2