How to swap collision mesh for final model?

   3181   2   1
User Avatar
Member
11 posts
Joined: July 2014
Offline
I'm very new to Houdini, and I'm sure this is something easy I'm overlooking, but I haven't been able to find the answer in all of my Googling. This is Houdini 12.5. I am having trouble using collision meshes that are different from the objects that they are driving.

During one point in an animation I am working on, there are several crystals rattling around inside a glass container. The actual meshes for the crystals are kind of soupy and too high-poly and generally unfit for simulation, so I made some low-poly collision meshes for each of them.

There are four different varieties of crystals, and each has randomized scale and rotation. I did this with 4 file nodes using a switch and copy stamp setup to randomize between the four different files, and a sphere with isooffset and scatter to randomize position, and a point node to randomize rotation and scale. That goes into the dop import, and all is well with the simulation as far as the collision geometry is concerned.

However, I have not yet been able to figure out how to correctly grab the data from the simulation to apply the same randomized file and initial transforms to the final models of the crystals. I don't want to actually use them in the simulation, I just want them to match the id (used to determine file number), scale, and other transforms from the sim.

Like I said, this is probably really easy, I'm just not sure which nodes I need. Could anyone either point me in the right direction or towards a tutorial that explains this sort of thing?

Attachments:
crystalbowl.zip (142.3 KB)

User Avatar
Member
11 posts
Joined: July 2014
Offline
Thanks for the reply, Joker386. I'm having some trouble getting this to work, however. I'm not sure where the centroid expression goes in the first reply, and without it the foreach is giving me every vertex of my low-poly model. I also don't have the same geometry on each point, and figuring out how to match the right crystals to the collision meshes they go with is part of my problem.

With the second solution, the create points to represent objects mode seems to do something strange where all of the points start out at the origin and transform from there, which is interesting because they seem to transform the same way that the crystals in the bowl do except with the motions scaled way up and offset so that the starting point is at the origin.

Also I realized I probably didn't have permissions set on the file I shared to be openable by everyone, so here's that fixed.

EDIT: on further inspection, I don't think the points to represent objects thing is matching the crystal's transforms at all, they all seem to be scattered around the surface of an invisible sphere centered on the middle of the bowl and with a radius equal to the distance from there to the origin. I have no idea what their motions relate to.

Attachments:
crystalbowl.zip (143.9 KB)

  • Quick Links