Back to Browse

OpenGL Ray Casting & Sphere Intersection (Learn EASIER than Ever)

1.3K views
Dec 11, 2023
46:12

An awesome 100% working example… with source code available from my website. Watch this video and you’ll learn in depth, exactly how ray casting works, implemented using OpenGL. Mouse picking via ray casting has various performance advantages compared to pixel picking. Some people consider pixel picking to be a cool hack that’s good enough for what they need. On the other hand we have ray casting, which is a fundamentally different process, enabling you to interact directly with the geometry of model meshes in 3D space. 00:00 - Introduction to ray casting 10:24 - Screen space to NDC to 3D space 13:54 - The inverse of 3D view space 16:47 - glm::unProject vs our ray test results 18:41 - Calculating the sphere intersect point 31:22 - Setting the sphere hotspot in the shaders 34:49 - Mouse controlling the sphere in 3D space 41:26 - Random orbits intersected by the ray 42:31 - Transparent hotspot vs green blob

Download

0 formats

No download links available.

OpenGL Ray Casting & Sphere Intersection (Learn EASIER than Ever) | NatokHD