That old OptiX SDK 3.9.x collision example was using ray tracing to determine the visibility between two points in space and just produced a binary visibility matrix.
The visualization of that was pure rasterization with OpenGL. Means the rays you see in the first image were actually OpenGL GL_LINES primitives. Probably the same in the second image.
What you’re asking for is very much possible with OptiX, since it’s a general purpose ray-casting SDK.
That has actually been done by multiple developers and presented in the past.
The second image you found is from this GTC 2014 presentation on simulation of car-to-car communication.
The simulation of such a transmitter/receiver setup is pretty much the same as direct lighting calculations in a path tracer.
Assume your transmitters are the cameras and the receivers the lights. Then instead of finding hits of the receiver with a brute force algorithm shooting rays randomly into the scene (which will be really bad when the receivers are small or impossible to hit when they are assumed to be points) you connect each surface hit point of the rays shot from the transmitter to the receivers to see if there is anything blocking the visibility and store the result in some data “connection” structure when not
Then you continue the current ray from its hit point with some distribution (scattering with reflection or transmission, diffraction, absorption, whatever your material handling requires.)
That will generate new rays and you can track whatever state you require along a ray path through the scene on your custom per-ray payload structure in OptiX and then store into some result output buffer.
This simulation can be run as a progressive path tracer.
I’ve explained a pseudo algorithm of something like that here before:
https://forums.developer.nvidia.com/t/sphere-intersection-with-ray-distance-dependent-radius/60405/6
(Ignore my idea of a “cone angle” there. That also works with full hemispherical distributions.
It should be rather straightforward to implement. The only complication is the material behavior for the ray distributions and how the resulting connection paths should be stored.)
Please use OptiX 7 when starting new developments. The resulting application will be be faster and more flexible.
When implementing visibility rays, please have a look at this post which explains the fastest way with OptiX 7:
https://forums.developer.nvidia.com/t/anyhit-program-as-shadow-ray-with-optix-7-2/181312/2
OptiX 7 supports curve primitives with linear, quadratic, and cubic splines, so it would be possible to visualize the rays in a ray traced renderer as well with linear curves, but since these are rather thin, that separate visualization renderer would need to be a little more sophisticated than just rendering lines in rasterization APIs like OpenGL, Vulkan or DirectX.