I put together a sample network to do this without resorting to matrices or a script of any kind. It works only if your geometry is already in camera space, which for the purposes of this sample, is accomplished by putting the camera at the origin (0,0,0) and facing down the negative z axis. I’d imagine the extra transform would be easy enough to to add in, though, if someone was so inclined.

You’ll note that the red square (transformed in 2d space) tracks to the center of the torus, regardless of the FOV you set in the camera or the resolution you set in the render TOP (it assumes square pixels… if you force a custom aspect ratio that isn’t equal to x resolution/y resolution, you’ll need to modify the network).

I based the math on this article: scratchapixel.com/lessons/3d … on-matrix/

Basically, it divides the x and y coordinates by z and then divides the whole thing by a perspective correction that is equal to tan((.5 * FOV) * (pi / 180)). Actually, that’s what the article says to do, but I first multiply z by -2, a number I found experimentally. I’m not sure why -2… I get why I needed to make it negative (it’s really the z distance from the origin that’s needed) but I’m not sure why it didn’t work until multiplying by a factor of 2. Perhaps someone with more of a background in math could explain whatever detail I’m missing here.