Thread: Avatar walk
View Single Post
  #4  
Old 03-20-2006, 02:10 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The following code will compute a random position within a certain radius.
Code:
#Get random direction
angle = viz.radians(vizmat.GetRandom(0,360))
	
#Get random radius between 5 and 10
radius = vizmat.GetRandom(5,10)
	
#Compute position
x = math.sin(angle) * radius
z = math.cos(angle) * radius
Reply With Quote