PDA

View Full Version : How to use precipitation.dle?


srwing
12-19-2009, 07:06 PM
I was wondering if anyone has any information about the precipitation.dle file in the Vizard plug-ins directory? I can not find any documentation on the use of this file and am wondering how to use it effectively and/or what kind of settings are available.


This is what I have so far :
precip = viz.add('precipitation.dle')
snow = precip.snow(1) #Create snow with intensity of 1
snow.setSpeed(0.0001)

Jeff
12-21-2009, 11:20 AM
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.
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)