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

triangle edge not an intersection? #4

Open
stephanschulz opened this issue Dec 20, 2017 · 1 comment
Open

triangle edge not an intersection? #4

stephanschulz opened this issue Dec 20, 2017 · 1 comment

Comments

@stephanschulz
Copy link

I am working of the sphere / ray intersection example.
I am noticing that when the ray is only touching the edge it is not considered an intersection.
This means when the ray moves a round there are short moments of non-intersection when it transitions from one triangle to an other.

How could I fix that?

Thanks.

@stephanschulz
Copy link
Author

I am now not 100% sure if the triangle edges either have a moment of non-detection or two edges create a detection at the same time.

I made this modified example that shows a red sphere when an intersection occurs and a blue one if the amount of intersections is odd.

According to this post an odd number of intersection means a point is inside the 3d object.
https://www.gamedev.net/forums/topic/630370-point-inside-or-outside-3d-object/?do=findComment&comment=4974163

At position 0,400,22 for example you can see that two triangles get activated at the same time, which makes for an even number of intersection. Which confuses my code thinking the point is not inside.
https://gist.github.com/stephanschulz/0806f9c3a63c8e1bd1eb2ca2c77874ec

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