home *** CD-ROM | disk | FTP | other *** search
- /* Bubbles!
- * Convert selected points to Random size Spheres. (Cuts initial object)
- * You select upper and lower radius bounds.
- * (Point Distribution is a good one to create the points first)
- * By Monte Ohrt © 1994 The Rendering Plant Inc. */
-
-
- Version = 1.0
- call addlib "LWModelerARexx.port", 0
- sysnam = 'Bubbles'
- signal on error
- signal on syntax
-
- call addlib "rexxsupport.library", 0, -30, 0
- MATHLIB="rexxmathlib.library"
- IF POS(MATHLIB, SHOW('L')) = 0 THEN
- IF ~ADDLIB (MATHLIB, 0, -30, 0) THEN DO
- call notify (1, "!Can't find "MATHLIB)
- exit
- END
-
-
- call sel_mode(USER)
- csurf=CurSurface()
-
- call req_begin sysnam
-
- id_txt = req_addcontrol("Bubbles!",'T', "")
- id_typ = req_addcontrol("Sphere Type", 'CH',"Globe Tesselated")
- id_srf = req_addcontrol("Surfaces",'R')
- id_tes = req_addcontrol("Tesselation Level", 'n')
- id_urad = req_addcontrol("Upper Radius",n,1)
- id_lrad = req_addcontrol("Lower Radius",n,1)
- id_sid = req_addcontrol("Globe Sides",'n')
- id_seg = req_addcontrol("Globe Segments",'n')
- call req_setval id_typ, 1
- call req_setval id_tes, 2
- call req_setval id_urad, 5
- call req_setval id_lrad, 1
- call req_setval id_sid, 16
- call req_setval id_seg, 8
- if (~req_post()) then do
- call req_end
- exit
- end
- type = req_getval(id_typ)
- tess = req_getval(id_tes)
- surf = req_getval(id_srf)
- urad = (req_getval(id_urad))
- lrad = (req_getval(id_lrad))
- side = req_getval(id_sid)
- segs = req_getval(id_seg)
- call req_end()
- say surf Csurf
- if surf~=CSurf then call surface(surf)
-
- n = xfrm_begin()
- do i = 1 to n
- Point.i= xfrm_getpos(i)
- end
- call xfrm_end()
- call CUT()
- call meter_begin n+1, 'Creating Spheres'
- do i=1 to n
- if (type=1) then do
- rad = (lrad+(urad-lrad)*(randu()))
- call MAKEBALL(rad,side,segs,point.i)
- call meter_step
- end
- else do
- rad = (lrad+(urad-lrad)*(randu()))
- call MAKETESBALL(rad,tess,point.i)
- call meter_step
- end
- end
- call remlib "LWModelerARexx.port"
- exit
-
- syntax:
- error:
- call end_all
- t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
- exit
-
- PointCount: PROCEDURE
- n=XFRM_BEGIN()
- call END_ALL()
- return n
-