some modifs about color height
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user