Additional changes with the heightmap
This commit is contained in:
parent
2c0d4424a2
commit
a83e6155b3
Binary file not shown.
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 127 B |
BIN
Levels/ObjectSetups/BackupLevel1.xcf
Normal file
BIN
Levels/ObjectSetups/BackupLevel1.xcf
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -123,6 +123,19 @@
|
|||||||
</object>
|
</object>
|
||||||
</composition>
|
</composition>
|
||||||
|
|
||||||
|
<!-- Static Block -->
|
||||||
|
<composition>
|
||||||
|
<typeID>140</typeID>
|
||||||
|
<object>
|
||||||
|
<modelPath>block.obj</modelPath>
|
||||||
|
<xOffset>0.0</xOffset>
|
||||||
|
<yOffset>10.0</yOffset>
|
||||||
|
<zOffset>2.0</zOffset>
|
||||||
|
<scale>1.5</scale>
|
||||||
|
<mass>0.0</mass>
|
||||||
|
</object>
|
||||||
|
</composition>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -136,7 +149,7 @@
|
|||||||
<shininess>3.0</shininess>
|
<shininess>3.0</shininess>
|
||||||
<physicType>Player</physicType>
|
<physicType>Player</physicType>
|
||||||
<radius>1.5</radius>
|
<radius>1.5</radius>
|
||||||
<dampningL>0.1</dampningL>
|
<dampningL>0.3</dampningL>
|
||||||
<dampningA>0.7</dampningA>
|
<dampningA>0.7</dampningA>
|
||||||
</objectData>
|
</objectData>
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 56 KiB |
BIN
Levels/ObjectSetups/Level1.xcf
Normal file
BIN
Levels/ObjectSetups/Level1.xcf
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 48 KiB |
Binary file not shown.
2
level.cc
2
level.cc
@ -81,7 +81,7 @@ void Level::load() {
|
|||||||
Material terrainMaterial = Material("seamlessTerrain.png", 0.1f, 0.8f, 0.2f, 3.0f);
|
Material terrainMaterial = Material("seamlessTerrain.png", 0.1f, 0.8f, 0.2f, 3.0f);
|
||||||
//Create object
|
//Create object
|
||||||
Object* terrainObject = new Object(terrainModel, terrainMaterial,
|
Object* terrainObject = new Object(terrainModel, terrainMaterial,
|
||||||
glm::vec3(-0.5f*(float)this->terrain.getHeightmapHeight(), 0.0f, -0.5f*(float)this->terrain.getHeightmapWidth()),
|
glm::vec3(-0.5*(float)this->terrain.getHeightmapHeight(), 0.0f, -0.5f*(float)this->terrain.getHeightmapWidth()),
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f));
|
glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
objects.push_back(terrainObject);
|
objects.push_back(terrainObject);
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ void Terrain::load() {
|
|||||||
for(unsigned int rowNum = 0; rowNum < this->heightmapHeight; rowNum++){ //read in the heightmap
|
for(unsigned int rowNum = 0; rowNum < this->heightmapHeight; rowNum++){ //read in the heightmap
|
||||||
this->heightmap[rowNum] = new float[this->heightmapWidth];
|
this->heightmap[rowNum] = new float[this->heightmapWidth];
|
||||||
for(unsigned int columnNum = 0; columnNum < this->heightmapWidth; columnNum++){
|
for(unsigned int columnNum = 0; columnNum < this->heightmapWidth; columnNum++){
|
||||||
this->heightmap[rowNum][columnNum] = (float)(image[(rowNum*heightmapWidth+columnNum)*4]) / 8; //<--heightmap is scaled here
|
this->heightmap[rowNum][columnNum] = (float)(image[(rowNum*heightmapWidth+columnNum)*4]) / 6; //<--heightmap is scaled here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user