Jitter points on surface... How?

   4379   5   2
User Avatar
Member
407 posts
Joined: Aug. 2015
Online
Hi Guys;

In my simple test scene, I converted a geometry(sphere) to points, then I add a “Point Jitter” sop to it.
The “Point Jitter” , moves points randomly along local axis of geometry, but I want to move them along NORMAL of each point.

I don't want to use Scatter, because I want the points exactly on geometry's points.

Any idea?
Edited by Masoud - April 27, 2017 04:58:30

Attachments:
JitterPoints.jpg (260.9 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
2534 posts
Joined: June 2008
Offline
Jitter along normal is just displace, right?

There is Displace Along Normal that you can construct inside a VOP.
Or just throw down a mountain SOP.
Edited by Enivob - April 27, 2017 08:34:53

Attachments:
Untitled-1.jpg (200.6 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
int seed        = chi('seed');
vector shift    = rand(@ptnum + seed);
int prims_nb[]  = pointprims(0, @ptnum);
float prims_num = 1 / float( len(prims_nb) );
int prim_choose = int( floor(shift.z / prims_num) );
int prim        = prims_nb[prim_choose];
vector pos      = primuv(0, "P", prim, shift);
@t = prims_num;
@P = pos;

pointprims tells you what primitives are connected to each point. with prims_num, prims_choose and prim the third component of a random value named shift gets assigned to one of those primitives. the first and second components of shift determine the UV location on the chosen primitive. Change the seed to get variations.

If you want it less overlapping, just set prim_choose to 0 and maybe delete prims_num.
Edited by Konstantin Magnus - April 28, 2017 03:33:42

Attachments:
jitter_on_surface.jpg (27.3 KB)
jitter_on_geo.hipnc (61.3 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
407 posts
Joined: Aug. 2015
Online
Enivob
Jitter along normal is just displace, right?

There is Displace Along Normal that you can construct inside a VOP.
Or just throw down a mountain SOP.

Hi Enivob and thanks for reply;

I don't want points leave the surface, so Displace or Mountain doesn't works.
Masoud Saadatmand (MSDVFX)
User Avatar
Member
407 posts
Joined: Aug. 2015
Online
Konstantin Magnus
int seed        = chi('seed');
vector shift    = rand(@ptnum + seed);
int prims_nb[]  = pointprims(0, @ptnum);
float prims_num = 1 / float( len(prims_nb) );
int prim_choose = int( floor(shift.z / prims_num) );
int prim        = prims_nb[prim_choose];
vector pos      = primuv(0, "P", prim, shift);
@t = prims_num;
@P = pos;

pointprims tells you what…
Hi Konstantin Magnus;

This is want I need, Thank you.
Edited by Masoud - April 28, 2017 06:27:49
Masoud Saadatmand (MSDVFX)
User Avatar
Member
7714 posts
Joined: July 2005
Offline
I haven't but I thought the Mountain SOP already did this?
  • Quick Links