Calculating reflecting vector

   2753   2   0
User Avatar
Member
109 posts
Joined: June 2008
Offline
Noob here again

How can i calculate reflecting vector in VOP SOP? I have googled it and i found sites with formulas…one of them was this (pure formula/math only):
http://ogldev.atspace.co.uk/www/tutorial19/tutorial19.html [ogldev.atspace.co.uk]

But it does not seem to work when i try to implement it in Houdini: maybe i don't understand the formula, or maybe i lay the nodes in invalid order.

I don't want to use single node, if there is such - i want to understand how its done, and then i can use the one node approach

Attached file contains a demo scene where i have tried to implement the formula. The plan, in the file, is that i can move to point and normal, and H will automatically calc a reflecting vector, and display it

Attachments:
test.hipnc (127.6 KB)

User Avatar
Member
606 posts
Joined: May 2007
Offline
Moro,

With this equation, I needs to be the incoming vector, with your setup it's an outgoing vector if you think about it.
Also, I does not need to be normalized if you want the full reflection vector, if you just need the direction then you're free to normalize..

Attachments:
kila_refltest_ee.hipnc (129.2 KB)

User Avatar
Member
109 posts
Joined: June 2008
Offline
I totally missed/skipped the incoming vector part! ops:
Thank You Eetu!!!
  • Quick Links