stevenvh nous illumina en ce 2008-06-25 05:11 -->
> I'm surprised (and a bit pissed off) not to find a means to round a number to
> the nearest integer.
> I want to use the rand() function to randomly generate a rotation angle which is
> a multiple of 90 degrees, which I would write in any programming language I know
> as
>
> RotAngle = 90 * round(4 * rand(RandSeed))
>
> How should I do this in POV-Ray?
> TIA
> Steven
>
>
>
>
>
Try this:
RotAngle= 90 * int(4 * rand(Seed))
The int() function return the integer part of a float argument.
--
Alain
-------------------------------------------------
Drive A: not responding.. .Formating C: instead
Post a reply to this message
|