visual 3d with buble effect and rays for slope null
This commit is contained in:
@@ -38,9 +38,18 @@ static void calcul_wall(t_rcast *rcast)
|
||||
rcast->wall.start.x = rcast->ray_nb;
|
||||
rcast->wall.end.x = rcast->ray_nb;
|
||||
if (rcast->is_x == 1 && rcast->slope_y != 0)
|
||||
{
|
||||
length = (rcast->next_x - rcast->ray_step_x) / ft_abs(rcast->slope_y);
|
||||
length = (double)length * (double)rcast->screen_dist.end.y / (double)rcast->slope_x;
|
||||
// length = (rcast->next_x - rcast->ray_step_x) / ft_abs(rcast->slope_y);
|
||||
}
|
||||
if (rcast->is_x == 0 && rcast->slope_x != 0)
|
||||
{
|
||||
length = (rcast->next_y - rcast->ray_step_y) / ft_abs(rcast->slope_x);
|
||||
length = (double)length * (double)rcast->screen_dist.end.y / (double)rcast->slope_y;
|
||||
// length = (rcast->next_y - rcast->ray_step_y) / ft_abs(rcast->slope_x);
|
||||
}
|
||||
length = ft_abs(length);
|
||||
height = rcast->wall_height - length;
|
||||
if (height < 0)
|
||||
height = 0;
|
||||
|
||||
Reference in New Issue
Block a user