Thread: Dot Product

Reply to Thread
Results 1 to 6 of 6
  1. #1 Dot Product 
    Join Date
    Oct 2007
    Location
    Now in K-Town, Los Angeles
    Posts
    460
    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?
    Reply With Quote  

  2. #2  
    Join Date
    Jul 2003
    Location
    germany
    Posts
    894

    nice one



    for what do yu need it? try the expression node (under Color->math)
    Reply With Quote  

  3. #3  
    Join Date
    Oct 2008
    Location
    Boston,MA
    Posts
    345
    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:
    Attached Files
    Reply With Quote  

  4. #4  
    Join Date
    Jul 2003
    Location
    germany
    Posts
    894
    Quote Originally Posted by jeremybrown View Post
    however, the expression node only takes one input
    but you can shuffle/copy the second input into a new layer and use that as second input
    Reply With Quote  

  5. #5  
    Join Date
    Sep 2004
    Posts
    1,202
    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.
    dg | ••• | imdb
    Reply With Quote  

  6. #6  
    Join Date
    Oct 2008
    Location
    Boston,MA
    Posts
    345
    ack! i can't believe i never found that node before! thanks diogo.
    Reply With Quote  

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 0
    Last Post: November 4th, 2008, 12:40 PM
  2. Adobe Introduces Creative Suite 4 Product Family
    By metalrahul in forum Your News
    Replies: 3
    Last Post: September 25th, 2008, 08:41 AM
  3. Adobe Unleashes Creative Suite 3 Product Line
    By CGnews in forum Industry News
    Replies: 4
    Last Post: March 28th, 2007, 08:53 PM
  4. Replies: 0
    Last Post: June 7th, 2004, 05:00 PM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts