Skip to content

Commit

Permalink
fix cube.cpp small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenxiZhou0619 committed Mar 10, 2023
1 parent 69ae992 commit 83f48bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Moer-lite的框架基于Moer主干:https://github.com/NJUCG/Moer .

## Update
- 2023-3-2 添加了进度条,whitted-style积分器,镜面材质以及一个新场景cornell-box。
- 2023-3-10
- 修改了Cube.cpp 28、29行bug(之前代码正确性不影响,但是逻辑不对)

## TODO
- 对mesh和sphere实现表面采样(目前只有parallelogram可以配置为面光源)
4 changes: 2 additions & 2 deletions src/FunctionLayer/Shape/Cube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Cube::Cube(const Json &json) : Shape(json) {

// 在计算时,所有计算都是在局部坐标系内完成的,因此这里只对boxMin和boxMax做scale操作
Matrix4f scale = transform.scale;
vecmat::vec4f min{boxMin[0], boxMin[0], boxMin[0], 1.f},
max{boxMax[0], boxMax[0], boxMax[0], 1.f};
vecmat::vec4f min{boxMin[0], boxMin[1], boxMin[2], 1.f},
max{boxMax[0], boxMax[1], boxMax[2], 1.f};
min = scale * min, max = scale * max;
min /= min[3], max /= max[3];
boxMin = Point3f{min[0], min[1], min[2]};
Expand Down

0 comments on commit 83f48bf

Please sign in to comment.