This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Game Development and the fly likes Beizer curve with three points? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Beizer curve with three points?" Watch "Beizer curve with three points?" New topic

Beizer curve with three points?

Bobby Sharma
Ranch Hand

Joined: Mar 18, 2008
Posts: 598

According to API documentation of the GeneralPath.curveTo :

public void curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)

Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the coordinates (x3, y3), using the specified points (x1, y1) and (x2, y2) as Bézier control points.

x1, y1 - the coordinates of the first Béezier control point
x2, y2 - the coordinates of the second Bézier control point
x3, y3 - the coordinates of the final endpoint

what's this final endpoint ? I am completely unable to draw meaningful from this function.

I googled and found that Cubic curve usually has four points but here we see only three points.Please provide me with
helpful information and explain how this function works?

best regards,

Most of the programming problems can't be solved because you don't know what the exact problem is.
Defining your problem correctly leads you to the right solution.
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3028
A GeneralPath has a "current point" which is basically the last point that was added to the path. That is used as the first point in the Bezier curve. The next three points are the ones that you supply in the arguments, for a total of four points.
Bobby Sharma
Ranch Hand

Joined: Mar 18, 2008
Posts: 598

Oh! I see , that's new to me.

thanks big fella
I agree. Here's the link:
subject: Beizer curve with three points?
It's not a secret anymore!