Perlin noise: Difference between revisions

Content added Content deleted
(added Factor)
m (→‎{{header|C}}: Remove vanity tags)
Line 76: Line 76:
A sign of how close C and Java are is this implementation which differs very little from Perlin's Java implementation. I only removed the static, public and final keywords and the Math class name from the floor calls, and it compiled without errors. Interestingly, in the paper, Perlin says that the benchmark implementation which was used to gauge the algorithm's performance was in C. One important improvement here is that the permutation data is externalized and read from a file. This way different textures and effects can be generated without having to change the source code.
A sign of how close C and Java are is this implementation which differs very little from Perlin's Java implementation. I only removed the static, public and final keywords and the Math class name from the floor calls, and it compiled without errors. Interestingly, in the paper, Perlin says that the benchmark implementation which was used to gauge the algorithm's performance was in C. One important improvement here is that the permutation data is externalized and read from a file. This way different textures and effects can be generated without having to change the source code.
<lang C>
<lang C>
/*Abhishek Ghosh, 5th November 2017*/

#include<stdlib.h>
#include<stdlib.h>
#include<stdio.h>
#include<stdio.h>
Line 149: Line 147:
Perlin Noise for (3.14,42,7) is 0.13691995878400012
Perlin Noise for (3.14,42,7) is 0.13691995878400012
</pre>
</pre>

=={{header|Common Lisp}}==
=={{header|Common Lisp}}==
<lang lisp>;;;; Translation from: Java
<lang lisp>;;;; Translation from: Java