Marching Squares Algorithm 的位移步骤
Marching Squares Algorithm's bit shifting step
我目前正在实施 Marching Squares 来计算等高线曲线,我对这里提到的位移位的使用有疑问
Compose the 4 bits at the corners of the cell to build a binary index: walk around the cell in a clockwise direction appending the bit to the index, using bitwise OR and left-shift, from most significant bit at the top left, to least significant bit at the bottom left. The resulting 4-bit index can have 16 possible values in the range 0–15.
我将高度数据放置在指定 (x,y) 处每个顶点的角上。然后,我通过执行检查以查看此高度数据是大于还是小于指定的等值(例如轮廓水平),将此高度数据转换为 0 和 1。现在顶点不是 0 就是 1。下一步的目的是什么,即顺时针方向遍历计算4位索引?
编一个四位码的目的只是为了识别配置,十六种情况之一。
您完全可以改用四个嵌套的 if/then/else 语句。
我目前正在实施 Marching Squares 来计算等高线曲线,我对这里提到的位移位的使用有疑问
Compose the 4 bits at the corners of the cell to build a binary index: walk around the cell in a clockwise direction appending the bit to the index, using bitwise OR and left-shift, from most significant bit at the top left, to least significant bit at the bottom left. The resulting 4-bit index can have 16 possible values in the range 0–15.
我将高度数据放置在指定 (x,y) 处每个顶点的角上。然后,我通过执行检查以查看此高度数据是大于还是小于指定的等值(例如轮廓水平),将此高度数据转换为 0 和 1。现在顶点不是 0 就是 1。下一步的目的是什么,即顺时针方向遍历计算4位索引?
编一个四位码的目的只是为了识别配置,十六种情况之一。
您完全可以改用四个嵌套的 if/then/else 语句。