logo
By Lawrence

5 minutes

Rocks That Look Like Rocks

The stream is a line of white spheres, and the plant ring sits still. Rocks should be lumpy and should tumble.

A seed for the shape, a quaternion for the turn

Each rock's surface is pushed in and out by a sum of sine waves whose phases come from a seed, plus one lobe, one hollow and a stretch. The seed comes from the entity's id, so a pool slot is the same rock for life.

A tumble is a turn. Three Euler angles, each advanced by its own rate, are not a turn about the rate's axis once two of them move. Engines also read the three in different orders: Babylon turns about Y, then X, then Z, and Three about X, then Y, then Z. With a rate of [1, 1, 0]:

after 1 s       Euler angles [1, 1, 0], read by Babylon     27° off a true turn about (1, 1, 0)
                the same angles, read by Three              53° from Babylon's pose
after 2 s       Babylon against Three                       180°
one quaternion step a frame                                 the true turn, to 0.000002°

Continue reading

Unlock the Full Course

Every lesson, the runnable examples, and the finished build — yours to keep.

$9one-time

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search