Hi,
I'm toying around with a simple filter that randomly distributes pixels around,
nothing fancy at all just creating a base plate for something more elaborate.
But it got me to the problem of generating random numbers while at the same
time keeping it continous over sessions. What I'm talking about is being able
to have a user knob called "seed" to give it a start to generate from, but then
(of course) being able to open Nuke at a later time and get exacly the same
result back as before if I give it the same seed number again. What's the
approach here?
I'm just generating a coordinate offset for each pixel with these lines:
float rndX = (float)rand()/(float)RAND_MAX;
float rndY = (float)rand()/(float)RAND_MAX;
And I've been playing with srand(seed), and have the user "seed" knob store
it's result in the seed int variable, but not been able to get the results I
want..
What's the correct approach for this kind of plugin? Have I missed a good
example of it somewhere?
Cheers,
D.
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev