-
October 17th, 2004, 09:25 PM
#1
urgent: bezier curves
hi guys!
is there a way to draw bezier curves without using the GDI functions? like, drawing the curve as connected lines? i've already got the four control points for the curves.. is there any way to do that? like a formula? thanks!
-
October 18th, 2004, 01:54 PM
#2
Re: urgent: bezier curves
Hi..
Code:
X(a) = Ax·a³ + Bx·3·a²·b + Cx·3·a·b² + Dx·b³
Y(a) = Ay·a³ + By·3·a²·b + Cy·3·a·b² + Dy·b³
A, B, C and D are the control points.
'a' is a value from 0 to 1.
b=1-a
For example, if you want 5 straight lines representing your curve you step 'a' from 0 to 1 by 0.2.
If you need a 3rd dimension, it's very easy. Just add the following line:
Code:
Z(a) = Az·a³ + Bz·3·a²·b + Cz·3·a·b² + Dz·b³
Hope this helps.
Regards,
Michael
-
October 18th, 2004, 07:24 PM
#3
Re: urgent: bezier curves
thanks a lot! exactly what i wanted!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|