Skip to content
Snippets Groups Projects
Commit a6359888 authored by JonShard's avatar JonShard
Browse files

Added terrain color based on height.

parent 76e5a65f
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ entities: 6
model: randomTerrain
position: 0 0 0
rotation: 0 0 0
scale: 100 18 100
scale: 100 20 100
velocity: 0 0 0
angleVelocity: 0 0 0
......
......@@ -187,7 +187,7 @@ int ModelSystem::makeTerrain(const C::Tag& tag, const C::Tag& materialTag, const
// Set position:
pos = glm::vec3(1 / float(X) * j,
heightMap[i * X + j] / 255.0f,
int(heightMap[i * X + j]) / 255.0f,
1 / float(Y) * i * aspect);
vertex.x = pos.x - 0.5f; // -0.5 to move origin to center of model.
......
......@@ -67,7 +67,7 @@ int main(int argc, char** args)
Init::loadOBJFiles();
ModelSystem::makeTerrain("randomTerrain", "standard", "standard", 20, 20);
ModelSystem::makeTerrain("randomTerrain", "terrain", "terrain", 20, 20);
LOG_DEBUG("Argc %d, args[1] %s", argc, args[1]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment