pscale base on camera distance and/or BBOX

   9866   6   2
User Avatar
Member
624 posts
Joined: Aug. 2008
Offline
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:

Attachments:
hou_pscale.jpg (263.1 KB)

User Avatar
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
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
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
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
User Avatar
Member
624 posts
Joined: Aug. 2008
Offline
tamte i thought doing the fit node in Vops will work. since it fit the bbox values from 0 to 1 i will check that again

peter uvw from camera that a new cool trick i will see how to implement the nodes later on. i didn't know w did something at all

thanks i will post my findings later
User Avatar
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
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
624 posts
Joined: Aug. 2008
Offline
just reconected the axis that i wanted into the fit.

nice that we have the point by bbox in vops didnt.

Attachments:
hou_pscale2.jpg (142.7 KB)

User Avatar
Member
5 posts
Joined: May 2017
Offline
Hi guys. I was trying to get this effect from camera with no luck in Houdini 15. I need to get the size from the distance to camera for grain particles, im newbee and all what i coul find in internet didnt helped me to gain this effect. Hope you can help me.
  • Quick Links