Jump to content

Randomizing Color of Grid Points


platypus

Recommended Posts

ok. extremely newbie-ish question here, but here goes...

I am starting with a grid, appending a point SOP. I am then attempting to randomize the color of each point on the grid, in order to copy a geometry to the points and have them inherit the random color.

any suggestions? am I going about this properly at all?

many thanks in advance.

Link to comment
Share on other sites

well, copy stamping would be the way to do it, but if you've never done it, it can be tricky to figure out. I don't know if there's any good tutorials on it out there....

anyway, here's a hipfile, cause that's faster than trying to explain it :)

things to look out for are the param expressions in the point sop under the sphere, and the point expressions in the copy sop.

color_stamp.hip.gz

Link to comment
Share on other sites

Alternatively you could randomise the point colours in the point sop and just click on the "Copy Template Point Attributes" in the point SOP. That will make all the copied spheres inherit all attributes from the template, including colour. :)

For the randomise, (it may be in that hipfile already, but its quick to explain) just make sure you use a different seed for each point ie.

rand($PT) in the $CR field, rand($PT*2) in the $CG and rand($PT*4) in the $CB field. The numbers don't matter, as long as the value is different. $PT will change the seed per point.

Hope this helps

Marc

Link to comment
Share on other sites

Alternatively you could randomise the point colours in the point sop and just click on the "Copy Template Point Attributes" in the point SOP. That will make all the copied spheres inherit all attributes from the template, including colour. :)

:o

at some point you realize your thinking is too complicated, and you have to sit back and remember the simple things :P

Thanks Mark!

Jens

P.S. if you want a quick example of copystamping as well as using point expressions, check out my file anyways ;)

Link to comment
Share on other sites

much and many thanks to all three of you!!!

Marc - i have used your pointers and it worked out great. so simple, and i have been beating my head against the monitor for hours on this. heheh. the more familiar I become with Houdini, the more i love its (deceptive) simplicity - maybe straightforward approach is a better way to put it. I guess it is all just a matter of getting to know your way around, the operators.

I will check out the hip file next.

you guys are tremendous!

thanks again.

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...