Point function

   3212   1   1
User Avatar
Member
5 posts
Joined: Nov. 2016
Offline
Hello All, I am currently working through the tutorial by Ben Watts “Quick tip 04- Custom forces in Houdini”.

There is a point in the video https://vimeo.com/189873077 [vimeo.com] —- 7:45

Where he uses the point function within a wrangle to set up a vector attribute equivalent to the normal attribute in the second input.

vector normal = point(1, ‘N’, @ptnum);

How is it that this line of code is actually calling input 2s normals in the first place? //

Looking at the help docs, the way I understand this is you are generating a vector variable, called normal, which is sourcing two pieces of information from input 1–the normal attribute “N”, as well as the point number. How exactly is this function as is giving you this vector equivalent to the N value from input 2?
If my code is written to include the following as well:
vector normal = point(1, ‘N’, @ptnum);
@N = normal;


then it is easier to see this visually, as the “N” attribute now equals the normal attribute, but based on the definition of what the point function is doing, I just dont see how the point function, as written, gets you this value at all–my interpretation is merely that now you have a vector called normal identical to “N”…..I have attached the scene file and a pick. The wrangle in question has a red backdrop. Thank You!!

Attachments:
CostumeForces.hipnc (165.4 KB)
CostumeForces.jpg (115.9 KB)

User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Moin,

I haven't watched the tutorial and don't have H installed here, so I apologize if I should completely miss the point. I think, however, that your irritation comes from the function call itself.
The “point” function is overloaded, so the first parameter can be a path (relative or absolute) - i.e. a string - to a node. But it can also be in Integer, as in this case.
If the first parameter is an Integer, input for the function “point” is taken from the wrangle node's inputs, with the first on the left being input number 0, second on the left being 1. Here, input “1” (which is the second input) is used.
“N” (a string) tells the function that the attribute named “N” (normal) is to be taken FROM the point declared by “@ptnum” from the second input.

It takes some time to get the mixup of (local, piped-in) attributes, variables and casts sorted out. The best way I have found to familiarize myself with it is to write my own code and not rely too much on tutorials. While tutorials are great to give you the basic picture, you need to “trial and error” for a bit to really “get it”.

I hope this helps!

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
  • Quick Links