enum e_object_type type;
type = object->type;
- return (type == PLANE);
+ return (type != PLANE);
}
double get_cylinder_circumsphere_radius(const t_cylinder *cylinder)
t_vec3 start;
t_vec3 projection;
- start = vec_diff(point, ray->start);
+ start = vec_diff(ray->start, point);
projection = vec_real_mul(ray->direction,
vec_scalar_mul(ray->direction, start));
- return (vec_norm(projection));
+ return (vec_norm(vec_diff(start, projection)));
}
int is_behind_ray(const t_ray *ray, t_vec3 point)
t_ray new_ray;
const t_object *obstruction;
+ result = (t_color){.x = 0, .y = 0, .z = 0};
i = 0;
while (i < scene->lights.size)
{