Skip to content

aleva147/3D-Terrain-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D-Terrain-Tool

Tool for creating and editing simple 3D terrain. Developed using Unity and based on the marching cubes algorithm.
A video demonstration is available on YouTube via the following link.


Project Description

This tool generates random terrain containing hills and valleys by sampling Perlin noise and implementing the marching cubes algorithm. The generated terrain can be rotated, zoomed, edited with a spherical brush, flattened to a given height, expanded or shrunk. The brush tool can create additional terrain only on top of the already existing terrain, not anywhere in the air. This way, the original terrain can be changed to have caves, tunnels, cliffs and floating pieces. Terrain is colored based on its height: the highest peaks are colored purple and the lowest points are colored red.

NOTE: There are currently two major flaws with this project:

  • Terrain size must remain relatively small. Otherwise, the terrain mesh becomes messy and unusable.
  • Flattening the terrain causes extremely fast performance of future brush actions (creating or erasing additional terrain). The code for the flattening function needs to be changed.

Unity version used: 6000.0.62f1


User Controls

  • Use arrow keys to rotate the terrain.
  • Use mouse wheel to zoom in or out.
  • Use '+' and '-' buttons to increase and decrease brush size.
  • Hold down left click to build terrain and right click to erase terrain at the cursor position.
  • Use UI to generate a new random terrain, flatten the existing terrain and expand/shrink the width of the terrain.

Useful Links

Below is a list of learning resources, used during the development of this project, recommended for better understanding of the marching cubes algorithm:

  1. "Coding Matching Squares" by The Coding Train
  2. "Coding Adventure: Marching Cubes" by Sebastian Lague
  3. "Polygonising a scalar field" by Paul Bourke
  4. "How to Make 7 Days to Die in Unity - 02 - (Smooth Terrain!)" by b3agz
  5. "Marching Cubes Algorithm || Unity & C#" by Freedom Coding

About

Tool for creating and editing simple 3D terrain. Developed using Unity and based on the marching cubes algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors