Scattering primitives of a mesh

   1928   7   1
User Avatar
Member
55 posts
Joined: April 2019
Offline
Hi,

I have a simple question. What's the simplest way to scatter primitives of a mesh onto a surface? In the attached image, i have 6 primitives belonging to a single mesh which I want to randomly scatter them on a grid.

Thanks

Attachments:
Screen Shot 2019-05-04 at 2.44.54 PM.png (681.4 KB)

VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
1616 posts
Joined: March 2009
Offline
“Simple” is super hard to define.

In the old world, where copy stamps would still be allowed, one could simply scatter points onto the grid (the same amount as primitives to be scattered), copy the geometry onto the points and then stamp the input to delete anything but the actual primitive and move it to the origin before the copy, so that every point would just have the respective primitive copied onto it.

Nowadays some places ban them, because stamps cannot be compiled and are thus slow, so you would need to do it differently.

Are they still allowed in your workflow?
Edited by protozoan - May 5, 2019 08:14:12
Martin Winkler
money man at Alarmstart Germany
User Avatar
Member
55 posts
Joined: April 2019
Offline
Yeah I noticed copy stamps are not recommended, so I didn't pursue that route. Instead I saw this post [forums.odforce.net] which seems pretty intuitive. For now i'm manually connecting 6 groups (since i have 6 primitives in the example) to the switch node and it's working well, but I wonder how I can automate the random switching of primitives without having to plug them one by one to the switch node. Any thoughts?
VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
89 posts
Joined: Jan. 2015
Offline
I would create an modulo ID based on the ptnum, and blast/copy the primitives on the points according to this @ID.
Not sure if it's the best approach, I'm already happy when things are working :O)
Edited by PaQ WaK - May 5, 2019 12:11:49

Attachments:
moduloscatter.hiplc (99.6 KB)
ModuloScatter.jpg (919.5 KB)

Gameloft
User Avatar
Member
833 posts
Joined: Jan. 2018
Offline
Look into MOPs, they might have something that you can use to accomplish what you need:

https://www.motionoperators.com [www.motionoperators.com]
>>Kays
For my Houdini tutorials and more visit:
https://www.youtube.com/c/RightBrainedTutorials [www.youtube.com]
User Avatar
Member
55 posts
Joined: April 2019
Offline
PaQ WaK
I would create an modulo ID based on the ptnum, and blast/copy the primitives on the points according to this @ID.
Not sure if it's the best approach, I'm already happy when things are working :O)
This is pretty much what I was looking for. The expression on the blast node is doing the trick. Appreciated!
Midphase
Look into MOPs, they might have something that you can use to accomplish what you need:

https://www.motionoperators.com [www.motionoperators.com]
That looks interesting. I will check them out.
VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
This should do what you want?
Edited by BabaJ - May 5, 2019 15:25:07

Attachments:
Randomize Prims Across Grid.hiplc (121.8 KB)

User Avatar
Member
55 posts
Joined: April 2019
Offline
BabaJ
This should do what you want?
Very nice and simple! I'm quite to new Houdini and still need to learn vex more but this is definitely doing the job too.
Thanks everyone!
VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
  • Quick Links