Using the expressions:
r(forward.u*width, forward.v*height)
g(forward.u*width, forward.v*height)
b(forward.u*width, forward.v*height)
(assuming forward.u and v are uv channels) one can replicate the stMap node’s behaviour (except for no subpixel filtering).
However, how would one go about getting the opposite behaviour?
That is, "projecting" something onto a uv pass at a certain frame and have it follow the uvs?
I have tried all mathematical formulas I can think of and at this point my head starts to hurt.
The problem is the way the expression node loops over the coordinates and REASSIGNS values.
It works like this:
for Red(at x coord, y coord) ASSIGN Red(at forward.u *width, forward.v*height)
What I am trying to do is:
for Red(at forward.u *width, forward.v*height) ASSIGN Red(at x coord, y coord).
I’m guessing I should divide by something and subtract half of the result by the x and y coordinates of something else (or something like that) but like I said, my head HURTS, so voila, I turn to you experts.. 🙂
Here is a visual breakdown (it might help explaining what I was trying to do:
img 1: My painted mask/element or whatever I want to have follow the uv pass.
img 2: uv pass
img 3: painted mask following the uvs using the expressions.
img 4: mask painted on top ov uv pass in view space
img 5: desired output that can then again be reassigned to follow the uvs using my expressions (or stmap).
Note: This is what I want. It is basically a "cropped" version of my mask where the x,y coordinates from the underlying uv pass are normalized to the project format so it can be retextured back onto the uv pass using stmap.
Hope anyone has any ideas!
Post a Comment