Jump to content

How to find the point with the smallest value (HSV) using VOPs?


Recommended Posts

I am trying to use the For Loop VOP but I am stuck with comparing 2 color values, because I can't find a is greater, is less than VOP.

Any ideas on how to do this?

Basically I want to find the point number with the smallest Value (HSV) just by using VOPs.

Thanks :)

Link to comment
Share on other sites

Basically I want to find the point number with the smallest Value (HSV) just by using VOPs.

Probably not understanding completely what your after but:

There's a min vop:

http://www.sidefx.com/docs/houdini11.1/nodes/vop/min

I'm also pretty sure CompareVOP has a 'less than':

http://www.sidefx.com/docs/houdini11.1/nodes/vop/compare

Or you use a sortSOP and pick the first point ...

Maybe ...

  • Like 1
Link to comment
Share on other sites

Hmm, this is pretty exhausting computation, isn't it? VEX will execute the loop over all points times number of points. For this reason people usually compute min/max of an attribute with AttributePromoteSOP.

Pure VEX/VOP method is to use Point Cloud by piping into position channel your color instead of P, so you effectively convert the point cloud into a color space. From that, it's easy to find minimum or maximum by opening a point could with extrema floats.

Edited by SYmek
  • Like 1
Link to comment
Share on other sites

Thanks Symek, you are right. I just wanted to do this because I saw a VOP tutorial showing the for loop where I solved that problem differently but wanted to use the for loop VOP just to learn it by coming up some simple case, but not practical :)

I never used point clouds in Houdini, but if I do that, will I be able to find the point number or the color? :)

I basically want to capture this point in some way. For instance color it differently or put it in a group.

I couldn't do it using the for loop VOP because it seemed very unintuitive.

Also the attribute promote technique is very clever, but still I wonder how will I capture the point with the lowest value?

Another simple problem I was trying to solve was to color a the furthest point from the center in collection of points. Can I do something like this in VOPs?

Thanks man :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...