Jump to content

fix primitive normals


rossl

Recommended Posts

In this case I wouldn't really be expecting much. Primitive normals are basically related to the surface of the primitive and in this case you don't have a surface, just lines. There's not really a way to reliably get a normal vector in this case. If you really need a vector that is perpendicular to the line segment then you'd be best constructing a vector based on the cross product between the first and last points of each line. However, there is still the matter of exactly what you want up to actually be.

Link to comment
Share on other sites

Yeah that's pretty much the most straight forward way to do it. Depending on your setup and the positioning of your wires you can get different results or reversing normals if you have points on both sides of an axis. Introducing an up vector type thing can help fix that however depending on what exactly you are going for and if you are animating or deforming then you will run into problems eventually.

With regards to the primitive N attribute not showing in the viewport, primitive normals aren't actually attributes. They are computed values based on the each primitive. This is why you can't modify them yourself, other than reversing/orienting the actual faces. You can access them like an attribute when using the prim() expression, but it's actually not reading an attribute.

Edited by graham
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...