what is up with normals in for loops?

   2287   4   0
User Avatar
Member
28 posts
Joined: Nov. 2015
Offline
@N = @N; is the only thing in the attrib wrangle. Why is it different? And how can I keep the value?

Attachments:
work1.png (35.2 KB)

User Avatar
Member
7771 posts
Joined: Sept. 2011
Offline
The foreach loop doesn't make sense in this context, what are you trying to do?
User Avatar
Member
28 posts
Joined: Nov. 2015
Offline
I'm looping over each primitive and the values I calculate are altered (signs changed) at the end of the for loop. I'm showing the normal in this example.
Edited by aoakenfo - Nov. 19, 2018 01:12:22
User Avatar
Member
7771 posts
Joined: Sept. 2011
Offline
AttribVop already runs over all primitives; looping just causes the topology to be disconnected.

Use a normal sop, set to primitives, to create face normals and then an attribwrangle in primitive mode with @N = -@N to add reversed normals to your faces.

Note that adding reversed normals to faces doesn't reverse them topologically. For that, use the reverse SOP.
User Avatar
Member
2 posts
Joined: June 2018
Offline
Thanks for the response and your time jsmack. Much appreciated.

I want to iterate over all primitives. I export the orientation of each face to another program and build a rotation matrix. The problem is, when I export the results at the end of the for loop everything faces the wrong way.

I'm exporting the forward and normal. If I export the forward and right vector, and calculate the normal myself, the face direction is correct. Signs changing on the forward and right vectors don't matter because they're both on the surface of the triangle.

Clear as mud?
  • Quick Links