Primitive normal guide position?

   9310   7   2
User Avatar
Member
17 posts
Joined: July 2007
Offline
hi,
a simple problem about primitive centriod, i use add(cex,cey,cez) sop get a point, it cant accordant to primitive normal guide position(i know centroid is the primitive boundingbox center, it parallel with grid, maybe my description is not exact.), described below pic, my question is how can get the position of PR normal.
thanks,
yeshi,

Attachments:
Primitive_centroid.jpg (54.6 KB)

User Avatar
Member
2199 posts
Joined: July 2005
Online
Oddly if you use a primitive sop and scale the primitive to 0 size with the default $CEX,$CEY,$CEZ as the center it ends up exactly where you want your point. However if you use $CEX,$CEY,$CEZ in an add sop it doesn't….

One thing you could do is make a scaled down version use the primitive sop and then reference one of the point positions into your add.

The other way is to use the prim expression to get the center like this

prim(“../myPoly”,0,“P”,0), prim(“../myPoly”,0,“P”,1), prim(“../myPoly”,0,“P”,2)

where myPoly is the name of the sop with containing your polygon.
The trick is finding just the right hammer for every screw
User Avatar
Member
17 posts
Joined: July 2007
Offline
thanks, ,
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
Simon
Oddly if you use a primitive sop and scale the primitive to 0 size with the default $CEX,$CEY,$CEZ as the center it ends up exactly where you want your point. However if you use $CEX,$CEY,$CEZ in an add sop it doesn't….

In the add SOP, $CEX,$CEY,$CEZ refer to the centroid of the bounding box, while in the primitive SOP, they refer to the centroid of the current primitive. Hence the difference. One could also use the prim() function with the “P” attribute in the add SOP to query a specific primitive's centroid.
User Avatar
Member
2199 posts
Joined: July 2005
Online
See the second part of my reply…
The trick is finding just the right hammer for every screw
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
Just goes to show that I'm a filthy skimmer.
User Avatar
Member
17 posts
Joined: July 2007
Offline
is there have a python replaced method for prim(“…”,$Pr,“P”, 0)?
thanks again,
User Avatar
Member
460 posts
Joined: July 2005
Offline
HI

I also need it this and I got it, now, how to I transfer the primitive normal to that point, so it point in the same direction?

thank you :wink:
varomix - Founder | Educator @ Mix Training
Technical Artist @ Meta Reality Labs
  • Quick Links