Intrinsic Primitive Normal

   2051   4   0
User Avatar
Member
2034 posts
Joined: Sept. 2015
Offline
I was wondering if I am missing something.

There doesn't seem to be any intrinsic values for primitive normals.

I would think that such a thing would be somewhere.

I have read somewhere that Houdini “creates the normals on the fly as needed, they are not stored anywhere”.

Which is why we have to do things like @N = @N in a wrangle to ‘bring them up’.

So it does make sense, but at the same time I can toggle in the viewport to display those ‘non-existing stored’ normals.

And when doing so it shows up very quickly, no matter how many primitives in the scene.( doesn't seem to take any computation time).

This makes me think that somewhere they do exist as an intrinsic and I am just looking in the wrong place.

Maybe it comes up in the viewport so quickly because its using an aspect of OpenGL…something not typically accesable at the SOP level?

I'm just wanting to grab a normal ‘belonging’ to a specific primitve elswhere in my scene.

I know I can do @My_Attribute_Name = @N where that primitive exists and just use a detailattrib to fetch it.

But for technical curiosity, am wondering if there is another way like using an vex intrinsic function instead.
User Avatar
Member
7726 posts
Joined: Sept. 2011
Offline
vector  prim_normal(<geometry>geometry, int prim_number, vector uvw)
User Avatar
Member
2034 posts
Joined: Sept. 2015
Offline
Thanks jsmack…you got me on not looking through the vex function docs thoroughly enough.


Edit: Hmmm. I'm guessing the uvw argument is for where ‘across the face’ of the prim one wants the Normal to ‘start’ from.

Will have to play around with this to see. But if so, opens up some new possibilities. Thanks again.
Edited by BabaJ - March 20, 2018 12:06:25
User Avatar
Member
8506 posts
Joined: July 2007
Offline
BabaJ
Edit: Hmmm. I'm guessing the uvw argument is for where ‘across the face’ of the prim one wants the Normal to ‘start’ from.


- for polygons uvw doesn't matter, at each location you'll get the same and the only primitive normal
- the uvw location is mostly important for NURBS and bezier surfaces

- so if you want interpolated normal for polys use primuv(), but then make sure you have N on your sampled geo
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2034 posts
Joined: Sept. 2015
Offline
Yeah…was playing around with that and noticed no affect with the uvw argument and found I could simply use 0 as an argument; Which is good in this particular case since I don't have to concern myself with setting up the values for that argument.( using prim_normal() with poly )

But in case I do want to explore what I alluded to thanks for the tip on primuv() and info on nurbs/bezier surfaces.
  • Quick Links