Grouping points according to normals

   7520   5   2
User Avatar
Member
5 posts
Joined: April 2011
Offline
Hi all, I am trying to group a bunch of specific points to emit particles from. My first idea was grouping it according to normals, but I do not know how to only group the bunch of points with similar normal directions together and not group the rest of the points. I also thought of grouping them by just dragging over the points and making a group out of it, but it isn't very procedural. I also tried grouping the points according to a boundingbox but as my geometry is moving over time, the boundingbox couldn't maintain the grouping of the points.Can anyone give me some ideas on how should I approach this problem? Thanks a lot.

Attachments:
pointgrouping.rar (1.2 MB)

User Avatar
Member
31 posts
Joined: Jan. 2007
Offline
I've attached an example of grouping by normal direction with some dot product magic. All the work happens in the VOP SOP, tweak the target vector and angle tolerance to choose what direction normals you want grouped.

Hope that helps!

Attachments:
normalgroup.hip (70.6 KB)

Facebook [facebook.com] | Twitter [twitter.com] | Google+ [plus.google.com]
User Avatar
Member
5 posts
Joined: April 2011
Offline
Darric
I've attached an example of grouping by normal direction with some dot product magic. All the work happens in the VOP SOP, tweak the target vector and angle tolerance to choose what direction normals you want grouped.

Hope that helps!


Hey thanks a lot, I am still trying to understand it but I get the overall concept. I will post questions here if I am still in any doubt. Thanks again!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
You don't need to resort to using a dot product to group by normals.

The Group SOP already has such an option. It a few different ways to grab faces by their normals. See the attached hip file.

As for the dot product, it is actually quite simple to understand and no math required. Just understanding. When you take two vectors, in Darric's case you have the point normal and a single direction vector, you normalize them (make them unit length of 1) then you can use the Dot operation on the two vectors.

The two vectors start at the origin.
The second vector is projected on to the first vector forming a right (90 degree) triangle.

The length of the projection (length of the reflection on to the first vector) is the result.

When the dot product equals 1, the two vectors are co-planar and in the same direction.
When the dot product equals 0, the two vectors are perpendicular (90 degrees apart)
When the dot product equals -1, the two vectors are co-planar but in opposite directions.

The test is quite simple then. If the dot product between the point normal and the direction vector equals 1 (co-planar), then grab the points.

Again no need to understand formulas to use dot products. Just the concept and let the Dot Product VOP do the heavy lifting for you.

Attachments:
300px-Dot_Product.svg.png (9.0 KB)
normalgroup_100_jw.hip (87.2 KB)

There's at least one school like the old school!
User Avatar
Member
31 posts
Joined: Jan. 2007
Offline
jeff
You don't need to resort to using a dot product to group by normals.

The Group SOP already has such an option. It a few different ways to grab faces by their normals. See the attached hip file.

Huh. So it does. I've never needed to use it, but still, I can't believe I've never noticed that.
Facebook [facebook.com] | Twitter [twitter.com] | Google+ [plus.google.com]
User Avatar
Member
5 posts
Joined: April 2011
Offline
Okay I understood already. Thanks a lot to both jeff and Darric.
  • Quick Links