WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   How to use precipitation.dle? (https://forum.worldviz.com/showthread.php?t=2445)

srwing 12-19-2009 07:06 PM

How to use precipitation.dle?
 
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.
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)



All times are GMT -7. The time now is 01:41 AM.

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