|
![](/i/fill.gif) |
"Kenneth" <kdw### [at] earthlink net> wrote:
> I suppose that a more 'strictly logical' approach (in the sense of first
> generating one large set of rand values to use, and not wasting any) would be
> something like this, done only once during the first frame of animation:
>
> ...
> Then, where I use my_rand in the scene...
> #read ***a particular my_rand value from the pre-#written list***
> ...
> An interesting idea (probably the same as or similar to Warp's original
> #write/#read scheme, now that I think of it.) I have no idea of its
> 'efficiency', though, compared to Chris B's original #while loop.
I guess it can be summed up into one word: "Desastrous" ;)
First thing to note is that it isn't any better than the original #while loop
approach: With POV SDL, unfortunately you can't just read "a particular" value
from a file. All you can do is read the file sequentially - so again you need
to pull the first numbers and discard them, until you reach the number you
want. So same problem as with Chris B's original approach.
Worse yet: Instead of a few computational steps required to pull a single random
value, you now have disk reads instead, *plus* some computational steps to parse
the plain-text numbers back to float values.
So all in all, it's quite a creative idea, but gives you more pain than gain :)
Post a reply to this message
|
![](/i/fill.gif) |