some modifs about color height

This commit is contained in:
asus
2024-01-09 17:46:14 +01:00
parent dcdf16d4e7
commit b2196a112e
10 changed files with 23 additions and 16 deletions

View File

@@ -72,15 +72,20 @@ void draw_lines(t_fdf *fdf, int *start, int *end)
void draw_color_pixel(t_fdf *fdf, int new_x, int new_y, int z)
{
int color;
int height;
color = 0xffffff;
z -= (z * fdf->zoom) / fdf->offset;
if (z > 0)
z /= fdf->altitude;
if (z > fdf->min_z && fdf->z_amplitude)
color = Z_COLOR;
height = z;
if (height != 0)
height /= fdf->altitude;
//height -= (height * fdf->zoom) / fdf->offset;
height -= height / fdf->offset;
if (height > fdf->min_z && fdf->z_amplitude)
{
color = color ^ (((0xff / fdf->z_amplitude) * (z - fdf->min_z)) << 16);
color = color ^ (((0xff / fdf->z_amplitude) * (z - fdf->min_z)) << 0);
color = color ^ (((0xff) * (height - fdf->min_z)) << 16);
color = color ^ (((0xff) * (height - fdf->min_z)) << 0);
//color = color ^ (((0xff / fdf->z_amplitude) * (height - fdf->min_z)) << 16);
//color = color ^ (((0xff / fdf->z_amplitude) * (height - fdf->min_z)) << 0);
}
draw_pixel(fdf, new_x, new_y, color);
}