remove divBy0
This commit is contained in:
parent
cf9e9175c2
commit
1e6e77e84d
1 changed files with 3 additions and 3 deletions
|
@ -68,9 +68,9 @@ Color Texture::color(float u, float v, bool interpolate) const {
|
|||
Color x2y1 = this->getPixelAt(static_cast<int>(x2), static_cast<int>(y1));
|
||||
Color x1y2 = this->getPixelAt(static_cast<int>(x1), static_cast<int>(y2));
|
||||
Color x2y2 = this->getPixelAt(static_cast<int>(x2), static_cast<int>(y2));
|
||||
Color fxy1 = ((x2 - x) / (x2 - x1)) * x1y1 + ((x - x1) / (x2 - x1)) * x2y1;
|
||||
Color fxy2 = ((x2 - x) / (x2 - x1)) * x1y2 + ((x - x1) / (x2 - x1)) * x2y2;
|
||||
color = ((y2 - y) / (y2 - y1)) * fxy1 + ((y - y1) / (y2 - y1)) * fxy2;
|
||||
Color fxy1 = (x2 - x) * x1y1 + (x - x1) * x2y1;
|
||||
Color fxy2 = (x2 - x) * x1y2 + (x - x1) * x2y2;
|
||||
color = (y2 - y) * fxy1 + (y - y1) * fxy2;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue