4.51.2.4.13. ogCreate() | Table of Contents | 4.51.2.4.15. ogCurve() |
procedure ogCubicBezierCurve(x1, y1, x2, y2, x3, y3, x4, y4:int32; segments : uInt32; colour:uInt32);Remarks:
Draws a cubic Bezier curve based on the coordinates (x1,y1),(x2,y2), (x3,y3),(x4,y4).
Segments is the number of line segments to use between points. The higher the number the smoother the line, but the longer it takes to render.
See also:
Sample code:{ogCubicBezierCurve.pas} uses ObjGfx40, CRT; begin randomize; if not screen^.ogCreate(640, 480, OG_PIXFMT_16BPP) then begin writeln('Error setting video mode'); halt end; repeat with screen^ do ogCubicBezierCurve(random(ogGetmaxX), random(ogGetMaxY), random(ogGetmaxX), random(ogGetMaxY), random(ogGetmaxX), random(ogGetMaxY), random(ogGetmaxX), random(ogGetMaxY), 25, random(65536)); if random(100)>97 then screen^.ogClear(screen^.ogRGB(0,0,0)); until keyPressed; while keyPressed do readKey end.
4.51.2.4.13. ogCreate() | Table of Contents | 4.51.2.4.15. ogCurve() |