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

Add collision between ray and cylinder #9

Open
yuripourre opened this issue Mar 6, 2019 · 2 comments
Open

Add collision between ray and cylinder #9

yuripourre opened this issue Mar 6, 2019 · 2 comments

Comments

@yuripourre
Copy link
Member

yuripourre commented Mar 6, 2019

@yuripourre
Copy link
Member Author

yuripourre commented Mar 6, 2019

https://github.com/lambdabaa/RayTracer/blob/master/ray/ray/surface/Cylinder.java

Transform your ray by the inverse of your cylinder matrix this way you have the ray in the local space of the cylinder. Then you can use the equation to find the intersection.
https://forums.khronos.org/showthread.php/55954

https://www.csie.ntu.edu.tw/~cyy/courses/rendering/pbrt-2.00/html/cylinder_8cpp_source.html

Quadric - Ray Intersection
https://gamedev.stackexchange.com/a/112895

@yuripourre
Copy link
Member Author

yuripourre commented Mar 8, 2019

Transform position and direction (and normalize)

https://gamedev.stackexchange.com/q/72440

Vector2.Transform() // applies the entire Matrix to the vector
Vector2.TransformNormal() // only applies the Scale and Rotational parts of the Matrix to the vector.

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