I'm creating a game in which I draw polygons of varying sizes and shapes using awt/Graphics2D. To smooth out the polygons, I want to use series of cubic Bezier curves to make smoother edges.

I spent some time poking around the Java awt and swing classes and saw the Bezier curves mentioned several times. I believe that awt has a class or two that allows me to define shapes out of Bezier curves, and more importantly, fill them. However, I have not been able to find that class yet and am hoping that you can point me in the right direction.

Here are the classes I found that mention Beziers:

http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/geom/PathIterator.html

Have you looked at the Shape interface, its implementing classes, and uses? I think QuadCurve2D.Double is a cubic bezier curve.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.