PDA

View Full Version : Random numbers and letters as texture



tcoursey
02-23-2012, 09:38 PM
ok I have a node tree that pulls random images based on node instances working well. (thanks to Hieron - http://forums.newtek.com/showthread.php?t=125939&highlight=random+image)

I'm now trying to make that a tad better. and easier to setup. My goal is to make a texture that I can use on a license plate. I'm not picky if it was only numbers or only letters, they don't have to be real, just "pass" for real.

My thought is if a node could render out a random number or letter, I could have 6 polys (or however many) on the plate that was filled in by a random letter or number.

Any thoughts on a node for this?

tcoursey
02-23-2012, 09:41 PM
one thought I just had was to have a single image that has all letters and number I wish to use, evenly spaced out on one row. Then drive the position of this image on each of the polys that should be a letter. Only thing is I know nothing about nodes.

Is there a way to drive the position of an image some how randomly, but using an even chunk? Meaning let's say I have a 1000 pixel wide image with 10 letters, each letter is within 0-100, 100-200, 200-300 etc..etc..

tcoursey
02-23-2012, 09:50 PM
here is a 9 number image, each number is found within 100 pixels. Maybe this can help someone play/test. Thanks for any ideas.

tcoursey
02-23-2012, 10:10 PM
am I on the right track? Seems like I could take the random number from the instance, take that value and turn it into a multiple of 100 and then position the u-offset. It's sort of working but I must be missing something, because the offset is not even.

Hieron
02-25-2012, 03:40 PM
Perhaps best to put up the scene etc as well for easier help.
I always assumed UV offset to be in UV space (which would make sense to me and explain your results). How is the image applied to UV space?

tcoursey
02-25-2012, 07:57 PM
ok I have it working to some level. I needed Input Spy to see what numbers were being spit out but the nodes.

Now I need a way to force a number within a range to become a certain number.

ie. 728 to become 700, or 801 to become 800.

100-200 is a range, 200-300 is a range 300-301 etc. The only thing I can get out of the nodes is the first part, 728, 821.9 etc..etc..

That moves my image more than I need, I need it to snap to the 100, 200, 300 400 values.

Any ideas on some math or logic that could do this? I played with the logic nodes but there isn't a within range, just greater and less than. hmm..

Danner
02-26-2012, 12:00 AM
multiply by 100?

omichon
02-26-2012, 02:11 AM
Akira Asagi has a AS_math_Nodes that contains a Round node that could be handy in this case.

http://www.lwplugindb.com/Plugin.aspx?id=95ec157b

Simon
02-26-2012, 05:41 AM
Hi make a UV for each poly and do a random UV offset.

Simon
02-26-2012, 05:44 AM
Scene ...

tcoursey
02-26-2012, 06:42 PM
Hi make a UV for each poly and do a random UV offset.
Simon, so close. I will need it to reference my "instances" so that each instance will have a different "random" plate.

I am very close, and I think the ROUND function will come in very handy, but that plugin is only 32 and the link is dead right now, from plugindb. I'll look elsewhere.

Thanks for all the help/direction. I'll post update if I get it figured out.

tcoursey
02-26-2012, 07:06 PM
Here is where I have gotten so far. Just plugging in different things to create the "randomness". This gives me random numbers based on instances but the actual surface is the same on all number plates. So this could work. I'll study a bit more and see if there are any tweaks that could take place.

tcoursey
02-27-2012, 10:01 AM
Simon,
You gave me some great ideas. I think this is the final setup, I will just tweak the textures from here. If anyone is interested this gives good results for what I was wanting. Here are the scene/objects/textures attached.

Thanks for everyones help. I'm enjoying diving into Nodes!

spunkyfl
03-11-2013, 12:12 PM
Hey tcoursey,

I just wanted to say thank you so much for posting that scene!! I was doing a quick search on this exact subject except to do different leaf textures on my instanced plants. This proved to be exactly what I needed. After I examined your scene I was up and running in no time.

Just wanted to express my gratitude - You Rock!