prev index next 
Functions and Looping 
 POV-Ray Tips, 
 Tricks, and Techniques
Random Numbers Within a Specific Range? 
 
XGamer has a simple question: Just a quickie on the Rand function in POV-Ray: Is it possible to have POV-Ray return a random number only found in a specified set of numbers? For example, could I have POV-Ray return only random numbers that are in the set of positive integers from 1 - 200? Something like that would be a good example of what I mean.
 
Nathan O'Brien has a simple answer:
try this:

  #declare R1 = seed(13)  
  #declare My_number = int(rand(R1) * 200)  

this should give you a random integer between 1 and 200 
 

  1