Compute orthogonal vector from a world point to camera [Solved]

I’m implementing fog of war for my game, and I stumbled into a problem of figuring out whether or not an object is visible behind the fog.

My fog is a plane with an alphaMap on it.

I implemented a method for picking fog value from alphaMap via a ray.

now i’m a bit stuck, I have a point in the world that I want to check for visibility, so I have origin point for my picking ray, but I don’t know how to obtain a direction.

Anyone knows how to compute the “pinhole” position for perspective camera?

image

some pictures from the game to give a bit more context:
with fog:
2018-12-15%2006_30_59-Start
without fog:
image

Answering my own question:
https://threejs.org/docs/#api/en/cameras/PerspectiveCamera.getFocalLength