![]() |
|
![]()
| MAS ETH ARCH/CAAD - 2005/06 - STUDENT PAGES Master of Advanced Studies in Architecture, Specialization in Computer Aided Architectural Design | 065-0005/6 Supervision: Prof. Dr. Ludger Hovestadt, Philipp Schaerer Chair of CAAD, ETH Zurich
assignmentpattern > > > sand | waves > > > first steps
setting up the scriptstoryboard
script> > > so far...
PROCEDURE Dune; VAR FirstQuest : INTEGER; SelPoly, WavePoly1A, WavePoly1B : HANDLE; GetPolyX, GetPolyY : REAL; ObjType : INTEGER; angle, density, intfer : REAL; StartX, StartY, L1X1, L1Y1, L1X2, L1Y2 : REAL; InCheck, InCheck2 : BOOLEAN; RadAng : REAL; i : INTEGER; vertAX, vertAY : REAL; BEGIN {######### FILL AN EXISTING POLY OR DRAW A NEW ONE?! #########} FirstQuest := IntDialog('Please select: 1 Fill an existing polygon or polyline. 2 Draw a new Polygon and fill it.','1'); IF (FirstQuest = 2) THEN BEGIN CallTool(-204); SelPoly := LObject; END; IF (FirstQuest = 1) THEN BEGIN AlrtDialog('Please select a polygon or polyline!'); REPEAT GetPt(GetPolyX,GetPolyY); SelPoly := PickObject(GetPolyX,GetPolyY); SetSelect(SelPoly ); ObjType := GetType(SelPoly); IF (ObjType < 5) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 6) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 7) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 8) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 9) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 10) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 11) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 12) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 13) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 14) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 15) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 16) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 17) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 18) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 19) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType = 20) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); IF (ObjType > 21) THEN AlrtDialog('Selected Object is not a polygon or a polyline! Try again!'); UNTIL (ObjType = 5) OR (ObjType = 21); END; {######### SET PARAMETERS BY USER #########} angle := RealDialog('Please enter angle of texture (in degrees):','45'); density := RealDialog('Please choose density: (Values between 0.1 (dense) and 10 (loose) recommended!)','1'); intfer := RealDialog('Please set interference: (Values between 0 and 1 recommended!)','0.50'); AlrtDialog('Please choose starting point!'); REPEAT GetPt(StartX,StartY); InCheck := PtInPoly(StartX,StartY,SelPoly); IF InCheck = FALSE THEN AlrtDialog('Please choose point IN or ON polyline/polygon!'); UNTIL (InCheck = TRUE); {######### DRAW FIRST SANDWAVE #########} RadAng := Deg2Rad(angle); L1X1 := StartX; L1Y1 := StartY; Smooth(2); BeginPoly; AddPoint(L1X1,L1Y1); WHILE (InCheck = TRUE) DO BEGIN L1X1 := (density * Cos(RadAng)) + L1X1 + (intfer * (random-0.5) * density); L1Y1 := (density * Sin(RadAng)) + L1Y1 + (intfer * (random-0.5) * density); InCheck := PtInPoly(L1X1,L1Y1,SelPoly); IF InCheck = TRUE THEN AddPoint(L1X1,L1Y1); END; EndPoly; WavePoly1A := LObject; ReDrawAll; L1X2 := StartX; L1Y2 := StartY; InCheck2 := TRUE; Smooth(2); BeginPoly; AddPoint(L1X2,L1Y2); WHILE (InCheck2 = TRUE) DO BEGIN L1X2 := L1X2 - (density * Cos(RadAng)) + (intfer * (random-0.5) * density); L1Y2 := L1Y2 - (density * Sin(RadAng)) + (intfer * (random-0.5) * density); InCheck2 := PtInPoly(L1X2,L1Y2,SelPoly); IF InCheck2 = TRUE THEN AddPoint(L1X2,L1Y2); END; EndPoly; WavePoly1B := LObject; ReDrawAll; END; Run(Dune);
temporary result
-- NDSMartinTann - 03 Nov 2005
|
This website has been archived and is no longer maintained.