Create different letters from particles?

   2643   6   1
User Avatar
Member
169 posts
Joined: April 2014
Offline
How would I go about creating different letters from particles. So each particle would have a random letter, preferably from a variable so that NOT all the letters are used.

So far I have a copy sop and I'm feeding the stamp in the font sop. I can get numbers to show, but how would I conform it to letters.

I'm not sure how to create random letters in the stamp value (copy sop) and have them show up in the font. I can do it with number but letters give errors.

Is there something I'm missing or maybe I'm thinking about this the wrong way.

Thank you.
Winter is coming!
User Avatar
Member
606 posts
Joined: May 2007
Offline
substr() is your friend here.

Attachments:
ee_randletter.hip (62.9 KB)

User Avatar
Member
169 posts
Joined: April 2014
Offline
Thank you So So Much

I was going in that direction but was really far from the formula you gave me. I broke it down to make sense of it… Thanks again.
Winter is coming!
User Avatar
Member
606 posts
Joined: May 2007
Offline
Here's another way of doing it, I wonder how many ways there are..

Attachments:
ee_randletter2.hip (67.1 KB)

User Avatar
Member
169 posts
Joined: April 2014
Offline
This is even more clever
Took me a while to figure it out.
I'm still stuck at this though:

rand($PT)*strlen(chs(“../font1/text”))
in the delete sop

so you're multiplying a random nr between 0-1 with the length of the text in the font sop where you have houdini.

So let's say for example

0.3(random nr) x 7(letters) = 2.1

And yet when I look what's coming out you have all neat integers from 0 to 6 (7 letters). What am I missing?

Also, what does the “+0” do at the end of this expression?

Sorry to bug you - just curious. Thanks for all your help.
Winter is coming!
User Avatar
Member
99 posts
Joined: July 2007
Offline
“letter” is an integer type attribute, so float values get rounded
User Avatar
Member
169 posts
Joined: April 2014
Offline
owlYzarc
“letter” is an integer type attribute, so float values get rounded

Ahhh, now I get it… Thank You
Winter is coming!
  • Quick Links