void rst::rasterizer::rasterize_triangle(const Triangle& t)
{
/*
// TODO : Find out the bounding box of current triangle.
// iterate through the pixel and find if the current pixel is inside the triangle
// If so, use the following code to get the interpolated z value.
//auto[alpha, beta, gamma] = computeBarycentric2D(x, y, t.v);
//float w_reciprocal = 1.0/(alpha / v[0].w() + beta / v[1].w() + gamma / v[2].w());
//float z_interpolated = alpha * v[0].z() / v[0].w() + beta * v[1].z() / v[1].w() + gamma * v[2].z() / v[2].w();
//z_interpolated *= w_reciprocal;
// TODO : set the current pixel (use the set_pixel function) to the color of the triangle (use getColor function) if it should be painted.
//TODO:找出当前三角形的边界框。
//遍历像素并找出当前像素是否在三角形内
重心坐标推导https://uploader.shimo.im/f/Fi1FKL5BKSfDPxnk.pngrasterize_trianglevoid rst::rasterizer::rasterize_triangle(const Triangle& t){ /* // TODO : Find out the bounding box of current triangle. // iterate through the pixel and find if th