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 in the function point_in_frustum(x, y, z, frustum) #26

Open
CharlesNord opened this issue Sep 27, 2020 · 1 comment
Open

Bug in the function point_in_frustum(x, y, z, frustum) #26

CharlesNord opened this issue Sep 27, 2020 · 1 comment

Comments

@CharlesNord
Copy link

def point_in_frustum(x, y, z, frustum):

Hi, thank you very much for your code. I think this function is not well implemented.
First of all, when we check if one point in a frustum, we should go through 6 faces rather than 3 faces.
so.

for p in range(0,3):

should be changed to

for p in range(0, 6)

Second, there is a typo in your code:

if(frustum[p, 0] * x + frustum[p, 1] * y + frustum[p, 2] + z + frustum[p, 3] <= 0):

the frustum[p, 2] + z should be changed to frustum[p, 2] * z

@dougsouza
Copy link
Owner

dougsouza commented Sep 28, 2020

@CharlesNord,

Yes, it looks like there is a typo. Would you care to make the changes, test and submit a PR?

Cheers

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

2 participants