Distribute points (randomly) in a mesh with an increase in density towards the center (Points from Volume)
9248 6 2- Gilgamesh
- Member
- 4 posts
- Joined: Feb. 2017
- Offline
Hello,
I'd like to randomly distribute points in a sphere but I'd like to increase density towards the center of it.
It took me some time to realise that I can't use the Scatter Node to distribute them inside a mesh, and so I use the Points from Volume Node.
In another thread [sidefx.com] I found basically what I was looking for, except it uses a plane and the Scatter Node. How do I translate this into a volume?
(Ideally I could controll the density with a ramp from surface to center.)
I'd like to randomly distribute points in a sphere but I'd like to increase density towards the center of it.
It took me some time to realise that I can't use the Scatter Node to distribute them inside a mesh, and so I use the Points from Volume Node.
In another thread [sidefx.com] I found basically what I was looking for, except it uses a plane and the Scatter Node. How do I translate this into a volume?
(Ideally I could controll the density with a ramp from surface to center.)
Houdini FX Apprentice 16.0.504.20
Windows 10 Pro 64 Bit
i7 6700k @ 4.5GHz
32GB Ram
970 GTX 3.5gb VRam
Windows 10 Pro 64 Bit
i7 6700k @ 4.5GHz
32GB Ram
970 GTX 3.5gb VRam
- dgsantana
- Member
- 8 posts
- Joined: Aug. 2007
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
If you generate an SDF type volume with the Iso Offset SOP and negate the SDF with the toggle, then pass this in to Scatter SOP you will get naturally get more points the further you are inside and away from the surface.
See the attached hip file for a complete exploration of scattering points in to SDF volumes. Please read the notes in the SOP network. When modifying SDF volumes it is important that you let anyone working with modified SDF volumes that it is no longer representative of the incoming geometry.
I added a Ramp Parameter option in a Volume VOP to remap the SDF to whatever you want as well.
Hope this helps.
See the attached hip file for a complete exploration of scattering points in to SDF volumes. Please read the notes in the SOP network. When modifying SDF volumes it is important that you let anyone working with modified SDF volumes that it is no longer representative of the incoming geometry.
I added a Ramp Parameter option in a Volume VOP to remap the SDF to whatever you want as well.
Hope this helps.
There's at least one school like the old school!
- DeKo
- Member
- 9 posts
- Joined: July 2013
- Offline
- Librarian
- Member
- 142 posts
- Joined: Aug. 2009
- Offline
- DeKo
- Member
- 9 posts
- Joined: July 2013
- Offline
- Andrea Sbabo
- Member
- 33 posts
- Joined: July 2017
- Offline
Maybe you can first scatter billions of points in your volume.
After that you sample your density to the points and delete a percentage of it based on the density. For example if the density is one you are going to keep all the points inside the voxel, if the density is 0.1 you keep just the 10% (you can do it by give to the point a random number and compare it to the desired percentage, but I think you already know how to do it )
After that you sample your density to the points and delete a percentage of it based on the density. For example if the density is one you are going to keep all the points inside the voxel, if the density is 0.1 you keep just the 10% (you can do it by give to the point a random number and compare it to the desired percentage, but I think you already know how to do it )
Edited by Andrea Sbabo - Jan. 31, 2020 15:51:32
FX Artist - Scanline VFX
-
- Quick Links