WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-19-2006, 01:56 PM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
I would like for them to appear within a radius of the subject. I want them to appear in front, to the left and right and behind the subject and certain intervals. They don't have to be random to the programmer, but appear random to the user. In other words, the order they appear is not important. So, basically, what I need to do is have them appear around the user coming in from all directions.
Reply With Quote
  #2  
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
  #3  
Old 03-21-2006, 09:06 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
Talking

Thanks! That really
Reply With Quote
  #4  
Old 03-21-2006, 09:14 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
Talking

Thanks! That really helped out
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC