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
void ColourIt() | |
{ | |
// COLOUR! | |
// Colour in elevations | |
// _stride - is the size in bytes of the width of the texture RGBA = 4bytes * width of texture. | |
// _textureSize - size (w & h) in pixels of the texture. | |
for (int y = 0; y < _textureSize; y++) |
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
void DefaultRegions() | |
{ | |
// Create regions | |
// Sea | |
AddRegion("Sea", Color.FromRgb(64, 126, 150), 115); | |
// Low Water | |
AddRegion("Low Water", Color.FromRgb(81, 173, 168), 125); | |
// Beach | |
AddRegion("Beach", Color.FromRgb(255, 189, 84), 130); |
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
public class Region | |
{ | |
public string name; | |
public Color baseColor; | |
public double[] range = new double[2]; | |
} | |
public List<Region> _regions = new List<Region>(); |
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
using System; | |
namespace Noise | |
{ | |
public static class SimplexNoise | |
{ | |
private static double F2 = 0.5 * (Math.Sqrt(3.0) - 1.0); | |
private static double G2 = (3.0 - Math.Sqrt(3.0)) / 6.0; | |
private static double F3 = 1.0 / 3.0; |
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
// Load base mesh | |
_currentModel = ModelImporter.Load(_localPath + @"Models\planetCube.3ds"); | |
Model3DGroup modelGroup = (Model3DGroup)_currentModel; | |
GeometryModel3D model = (GeometryModel3D)modelGroup.Children[0]; // The first child of model group is the imported mesh. | |
model.BackMaterial = null; | |
// Make spherical | |
MeshGeometry3D mesh = (MeshGeometry3D)model.Geometry; // Grab reference to raw mesh data. |