This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I wish there were a better way to do this! | |
#define func(type,name,param1,param2,body) type name(type param1,type param2) {body} | |
#define generic(name,param1,param2,body) func(float,name,param1,param2,body) func(vec2,name,param1,param2,body) func(vec3,name,param1,param2,body) func(vec4,name,param1,param2,body) | |
//define two "generic" functions using this macro | |
generic(add,a,b, | |
return a + b; | |
) | |
generic(sub,a,b, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Steps: | |
1. Download heightmap Bitmap | |
e.g. from terrain.party: http://terrain.party/api/export?name=guarda&box=10.186055,46.850130,10.080975,46.778264) | |
e.g. from earthe | |
Data Sets: NASA LPDAAC Collections -> NASA SRTM (SRTM 3) Collections | |
2. Use this site to convert BMP to Lua: https://codepen.io/Domiii/pen/oMJvoJ?editors=0010 | |
3. Copy the final Lua code to workspace.TerrainPixels (ModuleScript) | |
4. Run this script! |