Perlin noise: Difference between revisions
m
→{{header|M2000 Interpreter}}
No edit summary |
|||
Line 1,074:
Public:
function noise(x, y, z) {
}
function grad(hash, x, y, z) {
// Convert low 4 bits of hash code into 12 gradient directions
Line 1,086:
=if(binary.and(h,1) = 0-> u, -u) + if(binary.and(h, 2) = 0-> v, -v)
}
}
}
print Perlin.noise(3.14, 42.0, 7.0)
</syntaxhighlight>
{{out}}
Line 1,120 ⟶ 1,119:
0.136919958784
</pre>
=={{header|Lua}}==
|