View Single Post
  #2  
Old 12-21-2009, 11:20 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,466
After adding the plug-in you can either create a snow or rain object from that. Each one has methods that allow you to set the size, speed, and wind for the particles. Here is a sample script that you can use to change the effects.
Code:
import viz
viz.go()

viz.add('tut_ground.wrl')

precip = viz.add('precipitation.dle')
snow = precip.snow(1)

import vizmenu
menu = vizmenu.add()
OptionsMenu = menu.add('Options')
SpeedSlider = OptionsMenu.add(viz.PROGRESS_BAR,'Default','Speed')
SizeSlider = OptionsMenu.add(viz.PROGRESS_BAR,'Default','Size')
WindSlider = OptionsMenu.add(viz.PROGRESS_BAR,'0.00','Wind')
WindSlider.set(0.5)

def onSpeed(pos):
	val = pos*10
	snow.setSpeed(val)
	SpeedSlider.message('%.2f'%(val))
vizact.onslider(SpeedSlider,onSpeed)

def onSize(pos):
	val = pos*0.1
	snow.setSize(val)
	SizeSlider.message('%.2f'%(val))
vizact.onslider(SizeSlider,onSize)

def onWind(pos):
	val = pos*20 - 10
	snow.setWind([val,0,0])
	WindSlider.message('%.2f'%(val))
vizact.onslider(WindSlider,onWind)
Reply With Quote