home *** CD-ROM | disk | FTP | other *** search
- /*
- @N
-
- This Genie will draw flower like objects on the screen
- */
-
- msg = PDSetup.rexx(2,0)
- units = getclip(pds_units)
- if msg ~= 1 then exit_msg(msg)
-
- numeric digits 8
-
- call PDM_setbatchmode(0)
- call PDM_autoupdate(0)
-
- pi = 3.14159
- pi2 = 6.28318
- cr = '0a'x
-
- call pdm_unselectobj()
- man = pdm_getform("Flower Specificaitons",4,"petals:6"cr"sharpness:1.2"cr"Steps:9")
- if man = '' then exit_msg()
- parse var man order '0a'x sharp '0a'x stepval
-
- if ~(datatype(order,n) & datatype(sharp, n) & datatype(stepval, n)) then
- exit_msg("Invalid Entry")
-
- sharp = (sharp+1) * pi/2
- curcolor = pdm_GetFillPattern()
- parse var curcolor type '0a'x curcolor .
-
- color = pdm_SetFillPattern(,1,"Red")
- color = pdm_SetFillPattern(,1)
- parse var color filler '0a'x color '0a'x filler
- if color = '' then exit_msg()
- call pdm_setfillpattern(,1,color,)
-
- color = pdm_getcolordata(color)
- red = word(color,1)
- green = word(color,2)
- blue = word(color,3)
-
- b = PDM_getclickposn("Where do you want the center of the flower?")
-
- posx = word(b,1)
- posy = word(b,2)
- petal = ""
-
- do steps = 0 to order-1
-
- theta = pi2 * steps / order
- x = cos(theta) * 1
- y = sin(theta) * 1
- tx = cos(theta - sharp) * 1
- ty = sin(theta - sharp) * 1
- sx = cos(theta + sharp) * 1
- sy = sin(theta + sharp) * 1
- petal = petal || x" "y" "tx " "ty" "sx" "sy
- if (steps < order -1) then petal = petal","
-
- end
-
- do i = stepval to 0 by -1
-
- rgb = 1 - i/15
- scale = i * .125 + 0.5
- ang = i * 36
- call PDM_initplot(posx ,posy ,scale,scale,ang)
- call PDM_plotbezier(petal)
- obj = PDM_closeplot()
- colour = "UNNAMED RGB "red*rgb" "green*rgb" "blue*rgb
- call PDM_setfillpattern(obj,1,colour,)
-
- end
-
- exit_msg("")
-
-
- exit_msg: procedure expose units
- do
- parse arg message
-
- if message ~= '' then call pdm_Inform(1,message,)
- call pdm_AutoUpdate(1)
- call pdm_SetUnits(units)
- call pdm_SetBatchMode(0)
- exit
- end
-