Still dealing with a very strange issue (Mind fixing it, Kacperks?)

This commit is contained in:
2022-10-30 15:43:20 -04:00
parent 4c76fd1144
commit 3aa203bac9
5 changed files with 41 additions and 39 deletions

View File

@@ -43,13 +43,13 @@ void display()
glBegin(GL_QUADS);
for(int x = 0; x < 128; x++)
for(int x = 0; x < 16; x++)
{
for(int z = 0; z < 128; z++)
for(int y = 0; y < 64; y++)
{
for(int y = 0; y < 64; y++)
for(int z = 0; z < 16; z++)
{
Position2D block = BlockUtilities::getBlockFromNodeCoordinates(x, z);
// Math explanation for future reference:
// The if statement below checks if the node at the coordinate is greater than 0 (0 = air), the x and z coordinates
@@ -83,7 +83,7 @@ void reshape(int width, int height)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(20, width / (float) height, 5, 512.0F);
gluPerspective(30, width / (float) height, 5, 512.0F);
glViewport(0, 0, width, height);
glMatrixMode(GL_MODELVIEW);
@@ -184,7 +184,7 @@ int main(int argc, char **argv)
FastNoiseLite perlin, os, cellular;
int seed = 1338;
int seed = 138;
perlin.SetSeed(seed);
perlin.SetNoiseType(FastNoiseLite::NoiseType_Perlin);
perlin.SetFrequency(.01F);
@@ -207,7 +207,7 @@ int main(int argc, char **argv)
{
float cX = (float)x + (16 * bx);
float cZ = (float)z + (16 * bz);
for(int y = 0; y < 48 * abs(perlin.GetNoise(cX, cZ)) + (cellular.GetNoise(cX, cZ)) + 2; y++)
for(int y = 0; y < 48 * abs(perlin.GetNoise(cX, cZ)) + (cellular.GetNoise(cX, cZ)) + 3; y++)
{
blockManager.mapBlocks[bx][bz].addNode(y > 30 ? 1 : 2, 0, x, y, z);
}
@@ -220,20 +220,20 @@ int main(int argc, char **argv)
/*
for(int x = 0; x < 32; x++)
for(int y = 0; y < 16; y++)
{
for(int z = 0; z < 16; z++)
for(int x = 0; x < 16; x++)
{
for(int y = 0; y < 16; y++)
for(int z = 0; z < 16; z++)
{
Position2D block = BlockUtilities::getBlockFromNodeCoordinates(x, z);
printf("x - (blockX * 16): %i | X: %i, Y: %i, Z: %i, blockX: %i, blockZ: %i nodeAt: %i\n", x - (block.x * 16), x, y, z, block.x, block.z, blockManager.mapBlocks[block.x][block.z].getNodeAt(x - (block.x * 16), y, z));
printf("\n|x: %i |y: %i | z: %i | id: %i", x, y, z, blockManager.getNodeAt(x, y, z));
}
}
}
*/
*/