Maybe you noted a problem when considering the preceding flower example: drawing primitives by specifying the coordinates of all the vertices is a little cumbersome. There are too many numbers in the code, so it is hard to understand the relation between primitives. To solve this problem, we will learn about using the
ofPoint class and then apply it for drawing primitives using control points.
is a class that represents the coordinates of a 2D point. It has two main fields:
y, which are
ofPoint has the third field
ofPoint can be used for representing 3D points too (we use this capability in Chapter 7, Drawing in 3D). If you do not specify
z, it sets to zero by default, so in this case ...