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:


Recommended Answers

All 3 Replies

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, learning, and sharing knowledge.