Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug found in _get_culled_faces() #1936

Open
Bear-kai opened this issue Jan 16, 2025 · 0 comments
Open

Bug found in _get_culled_faces() #1936

Bear-kai opened this issue Jan 16, 2025 · 0 comments

Comments

@Bear-kai
Copy link

Bear-kai commented Jan 16, 2025

The code in renderer/mesh/clip.py link should be modified from

if op == "<":
    verts_clipped = face_verts[:, axis] < clip_value
else:
    verts_clipped = face_verts[:, axis] > clip_value

to

if op == "<":
    verts_clipped = face_verts[:, :,axis] < clip_value
else:
    verts_clipped = face_verts[:, :,axis] > clip_value

since the 3rd dimension stores the xyz locations in face_verts: (F,3,3) tensor.

Also note that the clipping_planes link are not consistent with the coordinate convention "x-left, y-up, z-inner" used in pytorch3d.

clipping_planes = (
        (frustum.left, 0, "<"),
        (frustum.right, 0, ">"),
        (frustum.top, 1, "<"),
        (frustum.bottom, 1, ">"),
        (frustum.znear, 2, "<"),
        (frustum.zfar, 2, ">"),
    )

The above snippet indicates the frustum is under "x-right, y-down, z-inner". It does not have any effect when we set, say "left=-1, right=1", but it somehow confused me at first. To be clear, I think it is better to set “left=1, right=-1” with

clipping_planes = (
        (frustum.left, 0, ">"),
        (frustum.right, 0, "<"),
        (frustum.top, 1, ">"),
        (frustum.bottom, 1, "<"),
        (frustum.znear, 2, "<"),
        (frustum.zfar, 2, ">"),
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant