Anyone got an example of the opposite of this decoding example
e.g how would you encode the same buffers back the other way. Sorry I am not very good with bit shifting code
var u = 0;
var v = 0;
var height = 0;
function zigZagDecode(value) {
return (value >> 1) ^ (-(value & 1));
}
for (i = 0; i < vertexCount; ++i) {
u += zigZagDecode(uBuffer[i]);
v += zigZagDecode(vBuffer[i]);
height += zigZagDecode(heightBuffer[i]);
uBuffer[i] = u;
vBuffer[i] = v;
heightBuffer[i] = height;