Requesting math for local space transform in shader

2020-08-13_local_WPO
does anyone know how to set up the world position offset so that the world space matches the object’s original position and orientation?

in my gif, there’s 2 flags, they have the same material. It’s just a V4 parameter plugged into world position offset, the one on the left is in world space, the one on the right is in a blueprint, and is a child of the blue pole,
Ideally if i rotate the pole, the flag would spin as if a child of the pole, instead it spins where it is. but I’m not sure how to set up the shader so the parameter controls act like a local space transform for the flag
any help would be great! thanks!

Ue4 has a transform node to do the math for you, so you don’t have to.

thanks, do you have a sample shader tree pic?, I tried a bunch of setups, and I still can’t figure out how to get it to move in localspace, cubes grow and shrink. and invert,

Yup.

image

You want to transform your vector from Local space to World Space to find the world space offset equivalent of your local space offset.

image

1 Like

oh man thanks so much! it worked! my original graphs were way more overcomplicated

!2020-08-14_local_WPO_small

1 Like