|
1638 | 1638 | <div class='together'>
|
1639 | 1639 | I just grabbed a random earth map from the web -- any standard projection will do for our purposes.
|
1640 | 1640 |
|
1641 |
| -  |
| 1641 | +  |
1642 | 1642 |
|
1643 | 1643 | </div>
|
1644 | 1644 |
|
|
1687 | 1687 | Earth map photo. The program will look for the file in the same directory as the executable. Make
|
1688 | 1688 | sure to copy the Earth into your build directory, or rewrite `earth()` to point somewhere else.
|
1689 | 1689 |
|
1690 |
| -  |
| 1690 | +  |
1691 | 1691 |
|
1692 | 1692 |
|
1693 | 1693 |
|
|
1697 | 1697 | To get cool looking solid textures most people use some form of Perlin noise. These are named after
|
1698 | 1698 | their inventor Ken Perlin. Perlin texture doesn’t return white noise like this:
|
1699 | 1699 |
|
1700 |
| -  |
| 1700 | +  |
1701 | 1701 |
|
1702 | 1702 | Instead it returns something similar to blurred white noise:
|
1703 | 1703 |
|
1704 |
| -  |
| 1704 | +  |
1705 | 1705 |
|
1706 | 1706 | </div>
|
1707 | 1707 |
|
|
1717 | 1717 | We could just tile all of space with a 3D array of random numbers and use them in blocks. You get
|
1718 | 1718 | something blocky where the repeating is clear:
|
1719 | 1719 |
|
1720 |
| -  |
| 1720 | +  |
1721 | 1721 |
|
1722 | 1722 | </div>
|
1723 | 1723 |
|
|
1855 | 1855 | <div class='together'>
|
1856 | 1856 | Add the hashing does scramble as hoped:
|
1857 | 1857 |
|
1858 |
| -  |
| 1858 | +  |
1859 | 1859 |
|
1860 | 1860 | </div>
|
1861 | 1861 |
|
|
1917 | 1917 | <div class='together'>
|
1918 | 1918 | And we get:
|
1919 | 1919 |
|
1920 |
| -  |
| 1920 | +  |
1922 | 1922 |
|
1923 | 1923 | </div>
|
1924 | 1924 |
|
|
1956 | 1956 | <div class='together'>
|
1957 | 1957 | This gives a smoother looking image:
|
1958 | 1958 |
|
1959 |
| -  |
| 1959 | +  |
1961 | 1961 |
|
1962 | 1962 | </div>
|
1963 | 1963 |
|
|
2009 | 2009 |
|
2010 | 2010 | which gives:
|
2011 | 2011 |
|
2012 |
| -  |
| 2012 | +  |
2013 | 2013 |
|
2014 | 2014 | </div>
|
2015 | 2015 |
|
|
2169 | 2169 | <div class='together'>
|
2170 | 2170 | This finally gives something more reasonable looking:
|
2171 | 2171 |
|
2172 |
| -  |
| 2172 | +  |
2174 | 2174 |
|
2175 | 2175 | </div>
|
2176 | 2176 |
|
|
2231 | 2231 | <div class='together'>
|
2232 | 2232 | Used directly, turbulence gives a sort of camouflage netting appearance:
|
2233 | 2233 |
|
2234 |
| -  |
| 2234 | +  |
2235 | 2235 |
|
2236 | 2236 | </div>
|
2237 | 2237 |
|
|
2267 | 2267 |
|
2268 | 2268 | Which yields:
|
2269 | 2269 |
|
2270 |
| -  |
| 2270 | +  |
2271 | 2271 |
|
2272 | 2272 | </div>
|
2273 | 2273 |
|
|
0 commit comments