How do I implement object picking, using OBB in OpenGL? I am trying to make 3D drawing software. I wanted to have the drag feature so I am using object picking using the OBB algorithm. I am facing problems in understanding the algorithm, and my implementation thus is having bugs.

How do I implement object picking, using OBB in OpenGL? As I am new to OpenGL (free-glut library), a step by step explanation would be helpful.

I am not able to understand what t1 and t2 mean and how the algorithm is working. If you explain the algorithm that would be enough.
Ray vs OBB intersection works by shooting a ray towards the OBB's planes. This results in 2 intersections referred to as t1 and t2 (per axis), also referred to as tNear and tFar or tMin and tMax.



Checking whether the ray intersects with the box, can then be done by comparing the largest tNear against the smallest tFar. If the largest tNear is less than the smallest tFar then there is a intersection.