move/rotate based on connectivity

   3626   2   1
User Avatar
Member
122 posts
Joined: May 2006
Offline
Hi, i attach a scene file, i want to move per box (each box is a collection of 6 prim or poly). The one in the left is translate only (i'm using primitive node to add translation using expression), so have no problem. The one in the right side, i add rotation based on connectivity class (i add expression in the primitive node), but the result is not like i want. it's more like a taper effect. I want each box to have its own rotation. It looks like each poly trying to rotate using its own center ?? any idea? how can i rotate each box as a group using the pivot or its centroid??

thanx.

Attachments:
move per-connectivity.hip (51.7 KB)

User Avatar
Staff
2540 posts
Joined: July 2005
Offline
One way is to move the Extrude down to the bottom of the chain. The Primitive SOP is doing what it is supposed to: work in individual primitives.
See the attached example file.

If you really need to move chunks of geometry, yes use the connectivity SOP and the Transform SOP in place of the Primitive SOP. You need to calculate the centroid of every chunk and then use that as the pivot point in the Transform SOP. You can do that in a number of ways: ForEach SOP on each chunk as early up as you can, Create a point per primitive and move that point to the centroid and then index in to the point position as it is carried along with the boxes.

In reality, most times you would be moving points with a normal N vector (v velocity works as well) and an UP vector, move your points and then copy your pieces to these points. Copy SOP will use the N and UP to orient your chunks plus Mantra will use the same logic if you choose to instance your chunks at render time.

Attachments:
move_per-connectivity_489_jw.hip (57.3 KB)

There's at least one school like the old school!
User Avatar
Member
122 posts
Joined: May 2006
Offline
jeff
One way is to move the Extrude down to the bottom of the chain. The Primitive SOP is doing what it is supposed to: work in individual primitives.
See the attached example file.

If you really need to move chunks of geometry, yes use the connectivity SOP and the Transform SOP in place of the Primitive SOP. You need to calculate the centroid of every chunk and then use that as the pivot point in the Transform SOP. You can do that in a number of ways: ForEach SOP on each chunk as early up as you can, Create a point per primitive and move that point to the centroid and then index in to the point position as it is carried along with the boxes.

Thanx Jeff, following your suggestion by using foreach, i've just managed to solve my problem. This foreach SOP , i've never touched it before, it's like a ‘black box’ to me. But as i learn to use it , it's really2 powerfull node…. i found this node really cool.

thanx
  • Quick Links