Tilt mesh using WorldPositionOffset

Hi guys,
I’m wondering if it’s possible to use the WorldPositionOffset node in a material to “tilt” a mesh in a particular direction? Feels like it should be simple but I don’t have the math powers to work it out myself.

To be clear, I don’t want to rotate the mesh, but to translate it based on it’s world height, giving the effect of leaning on one axis, turning square sides into rhombuses.

My main use case is a fence which I want to swing open while mainting it’s angle facing the 45° fixed camera.

Basically I want to achieve this but through a material.

Any ideas?