Get the App
SLTechnology News&Howtos  ›  Servers  › 

AGG lesson 17 Bezier curve control points

Shulou Source: shulou.com Published: 2022-06-02 08:28:22 09月29日 Update

Extracted from: http://blog.chinaunix.net/uid-20622737-id-3161025.html

/ / Bezier curve, the input parameters are the starting point coordinates, the first control point coordinates, the end point coordinates

/ / curve4 also adds the coordinates of the second control point as a parameter

Agg::curve3 curve (20,20,130,130,600,240)

Agg::conv_stroke stroke2 (curve)

Ras.add_path (stroke2)

Agg::render_scanlines_aa_solid (ras,sl,renb,agg::rgba8 (255j0pl 0))

At present, there is no use of any Bezier curve, nor any processing of related information, just a brief introduction to the use of this function. The control points described above do not make any adjustments, so they do not look like any curves and need to be calculated mathematically.

Describe again:

/ / Bezier curve, the input parameters are the starting point coordinates, the first control point coordinates, the end point coordinates

/ / curve4 also adds the coordinates of the second control point as a parameter

The constructor of the curve3 class is as follows:

Curve3 (double x1, double y1)

Double x2, double y2

Double x3, double y3)

The constructor of the curve4 class is as follows:

Curve4 (double x1, double y1)

Double x2, double y2

Double x3, double y3

Double x4, double y4)

Tags: Coordinates control points control curves parameters Bezier Bessel end point start point don't constructor input information again function mathematics appearance processing adjustment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Xiaomi Docker Apple Shulou Technology