Collision & spatial queries · 9 / 10

Morton Code / Z-Order

空間座標を近さが保たれやすい一次元順序へ並べる。

Compare in motion

空間の点群

Synchronized comparison
AReference
登録順で並べる

登録順で並べる

BMorton Code / Z-Order100%
空間的に近いデータをまとめやすい

空間的に近いデータをまとめやすい

Loading demo…

Scrub to pause and inspect. At 0%, B matches A; at 100%, B shows the effect. The scene repeats every 8 seconds.

Look for: 座標ビットを交互に並べる → 一次元の順序になる。

This model simplifies the technique to show its use case and effect. Operation counts describe the model; they are not performance measurements.

Read the storyboard

例: 空間の点群

  1. 1. Start

    点が二次元に並ぶ

  2. 2. Change

    座標ビットを交互に並べる

  3. 3. Result

    一次元の順序になる

空間的に近いデータをまとめやすい。時間変化を示す模式図です。実際の描画結果や処理速度を再現したものではありません。

How it works

  1. 1. Input

    多次元の座標

  2. 2. Process

    各軸のビットを交互に並べる

  3. 3. Result

    局所性のある一次元順序

A schematic of Morton Code / Z-Order. It shows the relationship between input, process, and result; exact values and rendering depend on the implementation.

Further reading

Box2D Collision ↗

A general reference for this subcategory.