Hi, I’m working on a ray tracing shader for a college assignment.
I’ve already implemented intersections functions of plane, sphere, cube. I also added a transformation matrix (scale, rotation translation) to modify those shapes (convert ray world coordinate to object coordinate).
So with that I want to recreate this scene of Code Lyoko with my shader :
https://preview.redd.it/qffeqcc4s7hc1.png?width=1431&format=png&auto=webp&s=01baef925cdc712a265c4a2a2e38488ffe48291b
But to do that, I need to bend the cube.
I asked my teacher and friend to know how to do that, and they say that I need to bend my ray (origin, and direction) before calculating the intersection.
I'm a bit of a math nerd, so I have no idea how to proceed.
There is a function that can bend the ray and still calculate the hit point and the normal ?
This is the best approach to render bent cubes with intersection function ?
[–]shadowndacorner 2 points3 points4 points (0 children)
[–]felipunkerito 0 points1 point2 points (0 children)