Okay, so I can do some math in Nuke like add, subtract, multiply using a merge node. Is there an easy way to do a dot product?
|
|
Okay, so I can do some math in Nuke like add, subtract, multiply using a merge node. Is there an easy way to do a dot product?
nice one
for what do yu need it? try the expression node (under Color->math)
my first impression was to write this into an expression node:
a=(r1*r2)+(g1*g2)+(b1*b2)
however, the expression node only takes one input and (as far as i can tell) you can't pass rgb values per pixel through expression links.
so, i got a little carried away and made a dot product gizmo (attached to this post).
just plug two images in, and it puts the result in the alpha channel. people should check my work though... i did this in about 10 minutes =)
on a related topic, why do you want to take the dot product in a merge node? i've never really heard of needing something like that for compositing. and looking at the output of the dot product, it didn't look terribly useful, although I am fully open to the fact that i could be missing the point, or doing it wrong.
here are the images i tested it with:
image a:
image b:
output:
![]()
Just use a Merge Expression instead.
Code:MergeExpression { inputs 2 expr0 Ar*Br expr1 Ag*Bg expr2 Ab*Bb expr3 (Ar*Br)+(Ag*Bg)+(Ab*Bb) name MergeExpression1 selected true xpos -288 ypos 53 }
Last edited by Diogo Girondi; December 3rd, 2008 at 06:05 PM.
ack! i can't believe i never found that node before! thanks diogo.
| « Previous Thread | Next Thread » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |