i have a POP simulation but i want the particles far away from the camera to be bigger and the ones closer by smaller.
do it base on the bbox min max.
this is what i got but the negative also is multipling, i thought
bbox( opinputpath(“.”,0), D_ZMAX) was 0 to 1
:roll:
pscale base on camera distance and/or BBOX
9866 6 2-
- pelos
- Member
- 624 posts
- Joined: Aug. 2008
- Offline
-
- tamte
- Member
- 9372 posts
- Joined: July 2007
- Online
I am little confused from your question, do you want it to be based on camera or bbox?
since the rest of your question is about bbox, let's focus on that
bbox() with D_ZMIN or D_ZMAX will return minimum/maximum value in Z so it can be any number not just 0-1
to get normalized value in 0-1, you need to fit current point Z value from D_ZMIN-D_ZMAX range to 0-1
in VOPs there is Point In Bounding Box VOP which will give you relative position in BBox where every axis will be normalized to 0-1, so just use its Z component
for the scale based on camera part I am sure you will find plenty of threads discussing that
since the rest of your question is about bbox, let's focus on that
bbox() with D_ZMIN or D_ZMAX will return minimum/maximum value in Z so it can be any number not just 0-1
to get normalized value in 0-1, you need to fit current point Z value from D_ZMIN-D_ZMAX range to 0-1
in VOPs there is Point In Bounding Box VOP which will give you relative position in BBox where every axis will be normalized to 0-1, so just use its Z component
for the scale based on camera part I am sure you will find plenty of threads discussing that
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- pbowmar
- Member
- 7046 posts
- Joined: July 2005
- Offline
You could also apply a UV Texture SOP with Projection from Camera turned on. The ‘uvw’ coordinate's third (“w”) value will be how far the points are from the camera. Negative is “behind” the camera, so you could either take the absolute value or clamp the value at 0.
Just a thought, not sure if it helps.
Cheers,
Peter B
Just a thought, not sure if it helps.
Cheers,
Peter B
Cheers,
Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
-
- pelos
- Member
- 624 posts
- Joined: Aug. 2008
- Offline
-
- tamte
- Member
- 9372 posts
- Joined: July 2007
- Online
fit will do that, but from your screenshot you are not fitting anything(just some default constant, probably 0), you need to connect actual Z component from P to first input of Fit to fit it from source range to out range
you can as well get bbox internally in VOPs with Bounding Box VOP then fit P from that range to 0-1,
but anyway, Point In Bounding Box VOP will do it for you
you can as well get bbox internally in VOPs with Bounding Box VOP then fit P from that range to 0-1,
but anyway, Point In Bounding Box VOP will do it for you
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- pelos
- Member
- 624 posts
- Joined: Aug. 2008
- Offline
-
- r0ckman
- Member
- 5 posts
- Joined: May 2017
- Offline
-
- Quick Links


