stmap inverted with expressions

Hi all.

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!

Attached Thumbnails

Click image for larger version

Name:	uvremap01.jpeg
Views:	N/A
Size:	29.1 KB
ID:	10055
 

Click image for larger version

Name:	uvremap02.jpeg
Views:	N/A
Size:	15.8 KB
ID:	10056
 

Click image for larger version

Name:	uvremap03.jpeg
Views:	N/A
Size:	18.0 KB
ID:	10057
 

Click image for larger version

Name:	uvremap04.jpeg
Views:	N/A
Size:	31.0 KB
ID:	10058
 

Click image for larger version

Name:	uvremap05.jpeg
Views:	N/A
Size:	30.6 KB
ID:	10059
 

No Responses to “stmap inverted with expressions”

Post a Comment