Skip to content

Bug found in _get_culled_faces() #1936

Open
@Bear-kai

Description

@Bear-kai

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, ">"),
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions