Bending space along an axis

I envision a modifier that “bends space” within a certain region. In the upper part of the attached image, X space stretches in the -X direction. Below that, XYZ space shrinks in the -X direction, yielding a “forced perspective” effect.

EDIT: here’s a more concrete visualization of what’s going on in the above image’s top part.

First off, is there a way to do this already? If not, which modifiers behave “similarly” so I can study their code before writing my own?

What you can do is have an array of planes with a refraction shader with a certain IOR

Your answer is pretty cryptic, some screenshots (with setting and results) can help a lot, IMHO

I wrote up a 2D example for you (EDIT: this behavior corresponds to the top half of the original image):
This should clarify things I hope!

Writing a modifier shouldn’t be too complicated (at least, not MATH-wise. In terms of navigating the source code, I’m a fish out of water), I foresee shifting every vertex by some function of its distance from the threshold.

I like that idea, if I’m interpreting it correctly. But would it work from every angle? What if the viewing angle is perpendicular to the planes you describe?

idk, I know that you can build lenses in Cycles, there is an add-on for that, but to achieve the sort of stuff you want to do, it’ll always be a hack

This is what a lattice does, if I understand correctly what you mean. When you move the associated geometry through the (deformed) lattice, it stretches just like this.


Wow, this is EXACTLY what I had in mind. Thanks so much. This will save me a TON of time.