Allow linking of portals with different aspect ratios
L1lith opened this issue ยท 1 comments
It would be really sick if we could link portals of different ratios. I don't see why the portal render couldn't just have it's visual scale changed to compensate when linking two portals of different ratios. Here's some math to show what I'm talking about
Portals
- Entry Portal: 2x2
- Exit Portal: 3x6
We can divide the width by the height to get the aspect ratio
- Entry Portal: 2 / 2 = 1
- Exit Portal: 3 / 6 = 0.5
As you can see the entry portal has a 1:1 ratio of width to height, and the exit portal has a ratio of 1:2. In order to render the view of the exit portal from inside the entry portal we can stretch and shrink the aspect ratio. In this case we need to multiply (or stretch out) the width of the exit portal by a factor of two (1 / 0.5 = 2) to make it fit the aspect ratio of the first portal. While this will cause the entry portal to look visually stretched, I don't think this is the end of the world as these kinds of "artifacts" already occur when using two different portals of different sizes (even if they have the same aspect ratio they look shrunken or enlarged).
Also having a feature like this would be really nifty in itself, also it would make it easier for the mod to know which portals to link when they have different aspect ratios