During the SDK, there is a sample about volume rendering using ray casting. And i come across a question about ray intersection with the bounding box. The origin source code is,
float tnear, tfar; int hit = intersectBox(eyeRay, boxMin, boxMax, &tnear, &tfar); if (!hit) return; if (tnear < 0.0f) tnear = 0.0f; // clamp to near plane
i don’t why tnear can’t less than zero.
Thank you very much.