Group the primitives that were hit by "Intersect"

   7758   6   4
User Avatar
Member
28 posts
Joined: Oct. 2013
Offline
Hi guys! First post here!
And the qustion is:

Inside Vops when you use the “Intersect node”, is there away to Group or somehow colect, the primitives that the ray hit?

Example: Grid that is on top of a sphere shoots rays downwards. How can I group the primitives of the sphere, that were hit so that I can delete them? Check the attached file!

Thanks in advance!

Attachments:
Locations ala Houdini 2.hip (189.4 KB)

User Avatar
Member
168 posts
Joined:
Offline
you can add different attribute per object (or use just color in that case), compare those values and use “addPoint to group” vex vop node on points that you want to group
Albert
User Avatar
Member
28 posts
Joined: Oct. 2013
Offline
..hmm..I don't get it I am afraid..

Firstly I don't get why should I compare an attribute To find the primitives? The numbers of the primitives of the sphere that get hit are given to me by the output of the “Intersect ” node called “prims” .Right?
Secondly I need the primitives to get in to a group, not the points .And there is no Add Prims to Group node….

And even if manage to get them in a group ,it will “live” on the grid but I need it to be on the merged sphere-box thingy so that I can delete their prims..

I am confused….

Attachments:
Locations ala Houdini 3.hip (191.9 KB)

User Avatar
Member
168 posts
Joined:
Offline
I think i misunderstood your question on the beginning, this is what you meant ?

Attachments:
locations_ala_houdini_4.hipnc (204.2 KB)

Albert
User Avatar
Member
28 posts
Joined: Oct. 2013
Offline
Although it seems perfect at the begining
I realized that the number of the prims that get hit isn't equal with number of the prims that get deleted. Something gets lost in the “Attribute transfer”…



Also when i increase the divisions of the geometries that get hit, the positions of the holes jump around something that shouldn't happen since the start of the ray and its direction is fixed.

I tried “First Match” in the Attribute Transfer but no luck

Attachments:
locations_ala_houdini_5.hipnc (206.3 KB)

User Avatar
Member
8554 posts
Joined: July 2007
Offline
you need to convert every point to primitive before attribtransfer instead of promoting attribute to primitive since existing primitives on projected grid don't have centers in corresponding hitpoints
simple copy of primitive spheres will do the job

Attachments:
locations_ala_houdini_5_fix.hipnc (253.0 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
28 posts
Joined: Oct. 2013
Offline
Thanks Tamte it works fine now! How on earth did you came up with this idea!?!
Thank you as well Tmdag for your help!

The bad think is that the lack of arrays in vops and the lack of array per point even in vex lead to inefficient solutions of simple problems…

Also the transfer attribute is slow!!!

And in this specific a case its raycasting for second time for no real reason.What I mean is that there was one raycast in the intersect node where we found what we wanted (the prim nums of that get hit).

If we could put these into an array as a details attribute and then copy that into the other geo without a new raycast it would be much more efficient and logical.

Maybe for some things I should just stick to ICE. I don't know…
  • Quick Links