Download presentation
Presentation is loading. Please wait.
1
Terrains Creating an Island
2
Find a map that may contain an island.
3
Zoom in on an island in a map.
4
Paste it into GIMP.
5
Crop & convert to grayscale.
6
Duplicate the layer and work on the duplicate.
7
Note water depth is actually a negative value
Note water depth is actually a negative value. So we’ll set the land to be above sea level . . .
8
. . . by setting it to 36 (+5 above the deepest water value of -31).
9
But it’s difficult to distinguish between the values.
10
So we’ll use 100 for sea level (to spread out the values).
11
Make a table of values (using a linear relationship).
But keep the gray values between [0..255] inclusive.
12
Alternative: Creating binary terrains with Java
Use FileOutputStream for binary output. (System.out.println produces ASCII text output.) Write a Java program that creates a file of 1000*1000 integer values in the range [0.255]. Be creative. You may wish to use sin, cos, tan, pow, etc. Load your file into GIMP. Send and print your program and a screen dump of the result in GIMP to me.
13
Extra: Simply check your raw file in GIMP by creating a .pgm file. Add the following to your code right before you write out the raw bytes: String s = “P5\n \n255\n"; Using the FileOutputStream, write out the above before you write any raw data.
14
Bring your new Terrain into Unity
Terrain --> Create Terrain Terrain --> Import Heightmap – Raw Then proceed working on Chapter 2: Environments in Unity Game Development Essentials.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.