Primitive Normal Direction

   20277   6   1
User Avatar
Member
53 posts
Joined: 5月 2006
Offline
Hello,

Is it possible to change the primitive normal direction?
Because I want to polyextrude a face and I have some problems when extruding.

With Regards.
Thank You.
User Avatar
Member
321 posts
Joined: 7月 2005
Offline
mmtpour
Hello,

Is it possible to change the primitive normal direction?
Because I want to polyextrude a face and I have some problems when extruding.

With Regards.
Thank You.
Nope. There is actually no such thing as a primitive normal. Unlike a point normal, a primitive normal is a derivation based on the vertices of the primitive. It's shown (and look-upable) as any other attribute, but it is not stored anywhere – just look at a .geo file, and you'll find point N, but no prim N. So to “change” the primitive normal, you need to move the points that belong to the poly.

– Antoine
Antoine Durr
Floq FX
antoine@floqfx.com
_________________
User Avatar
Member
4271 posts
Joined: 7月 2005
Offline
mmtpour
Hello,

Is it possible to change the primitive normal direction?
Because I want to polyextrude a face and I have some problems when extruding.

With Regards.
Thank You.

If you want to “flip” the primitive normal then use the Reverse SOP. It will reverse the vertex ordering of the primitive thus causing the primitive's ‘normal’ to point in the opposite direction.
if(coffees<2,round(float),float)
User Avatar
Member
53 posts
Joined: 5月 2006
Offline
Thanks guys,

In math it is possible to change the normal direction, so I though maybe it's the same thing in 3d Apps.

Thanks and Rgards.
Edited by - 2006年10月7日 11:03:52
User Avatar
Member
7899 posts
Joined: 7月 2005
Offline
I'm not sure I understand what “problems with extruding” are you having in the first place. The default orientation is the polygon normal. If you want to use a different direction, you can just move/rotate the PolyExtrude handle.
User Avatar
Member
53 posts
Joined: 5月 2006
Offline
Hi edward;

Thanks for the reply and never mind :idea:

Thank You.
User Avatar
Member
32 posts
Joined: 9月 2017
Offline
This was my #1 search hit on the topic without filtering the search by date so, I'd figure I throw this little support gem I got from Hector:

In Vex, you can get the primitive normal by:
// prim_normal(<geometry>geometry, int prim_number, float u, float v)
// in this case the u/v coordinates refer to the parametric coordinates
// of the single primitive, not the user defined UVs
vector normal = prim_normal(0, @primnum, 0.5, 0.5);

In my case, I was constructing something flat and wanted all normals to face up, so a group can be created that gets used in a reverse sop.
// add prims with bad normals to group
if(normal.y < 0) {
    i@group_reverse = 1;
}

Hopefully that helps someone being after this type of information.
Edited by akesso - 2019年1月10日 12:31:23
  • Quick Links