Heya, I’m working on a Portal effect, and I’ve watched a video explaining that I need the camera of the second portal to be relative to the world camera of the first camera. It’s a little bit confusing, but I get what it means (here’s an image)
note: the green camera is the world camera and the yellow camera is the viewportframe camera.
I would like to know the maths that I need to use to get this simple effect.
I’ve tried a couple of combinations of this:
if you want to transform a vector in one coordinate space (A) to another one in another coordinate space (B) you need to find the basis vectors of coordinate space B then multiply it by the matrix transformation using those basis vectors and the origin of the coordinate space. Since your cameras cframe is technically its own coordinate space (lookat matrix) you just do transformedAToB = B*A