mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 15:31:59 +00:00
use p1 to p4 instead of a matrix
This commit is contained in:
parent
f624514714
commit
295bdc0c89
2 changed files with 10 additions and 5 deletions
|
@ -95,8 +95,12 @@ Rectangle *Parser::getRectangle(const nlohmann::json &j, float ka, float kd,
|
|||
const Vector3f &cd, const Vector3f &cs,
|
||||
float pc) {
|
||||
Matrix<float, 3, 4> corners = getCorners(j);
|
||||
Vector3f p1 = getVector3f(j["p1"]);
|
||||
Vector3f p2 = getVector3f(j["p2"]);
|
||||
Vector3f p3 = getVector3f(j["p3"]);
|
||||
Vector3f p4 = getVector3f(j["p4"]);
|
||||
|
||||
return new Rectangle(ka, kd, ks, ca, cd, cs, pc, corners);
|
||||
return new Rectangle(ka, kd, ks, ca, cd, cs, pc, p1, p2, p3, p4);
|
||||
}
|
||||
|
||||
Light *Parser::getLight(const nlohmann::json &j) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue