Previous: 4.51.2.4.13. ogCreate() To the Table of Contents Next: 4.51.2.4.15. ogCurve()
4.51.2.4.13. ogCreate() Table of Contents 4.51.2.4.15. ogCurve()

- 4.51.2.4.14. -
Table of Contents
4. Standard Units
4.51. ObjGfx40 - ObjectGraphics 4.0 Unit
4.51.2. ObjGfx40 Unit Object Types
4.51.2.4. ogSurface object
4.51.2.4.14. ogCubicBezierCurve()


4.51.2.4.14. ogCubicBezierCurve()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Draws a cubic Bezier-curve directly using the basis functions.

Declaration:
  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.



Previous: 4.51.2.4.13. ogCreate() To the Table of Contents Next: 4.51.2.4.15. ogCurve()
4.51.2.4.13. ogCreate() Table of Contents 4.51.2.4.15. ogCurve()

- 4.51.2.4.14. -