Closed Gornhoth closed 2 years ago
您好,您的邮件我已收到并会尽快回复,祝好
@Gornhoth I think you might be on to something. Need to re-read the Schwarz & Seidel paper for this, but what you say seems logical. This has probably gone unspotted since non-cubical grids have indeed not been officially supported :)
I've fixed this in dev branch. Will make new release later.
Fixed in latest release.
I think I noticed something I think is slightly off in the implementation of equation 2 (second part where one calculates d) inside voxelize.cu in lines 131 - 133. For each edge projection into the ZX plane there is written:
float d_xz_ei = (-1.0f * glm::dot(n_zx_ei, glm::vec2(v0.z, v0.x))) + glm::max(0.0f, info.unit.x*n_zx_ei[0]) + glm::max(0.0f,info.unit.z*n_zx_ei[1]);
but shouldnt the supplied axis to eachmax
function actually be the same order as the previous two plane projections? For example XY where the first call tomax
has the first axis X likeinfo.unit.x * n_xy_ei[0]
and the second call tomax
has the second axis Y likeinfo.unit.y * n_xy_ei[1]
. For the ZX axis this would look like:float d_xz_ei = (-1.0f * glm::dot(n_zx_ei, glm::vec2(v0.z, v0.x))) + glm::max(0.0f, info.unit.z*n_zx_ei[0]) + glm::max(0.0f,info.unit.x*n_zx_ei[1]);
I think for the end product it does not matter currently as info.unit.x/y/z are the same at the moment (gridSize in main.cpp) but technically it is still wrong, or am i missing something here?