FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   quadratic Bezier ??
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: quadratic Bezier ??  (Read 438 times)
Ricard


quadratic Bezier ??
« on: Feb 18th, 2005, 1:43am »

Hi,
 
I'm back again with the same (maybe annoying) topic of the quadratic Beziers.
 
I was wondering what kind of interpolation was the curve() method
 
I was also quite interested in the quadratic Bezier.  I tried using the suggestion from fjen:
http://processing.org/discourse/yabb/board_Proce55ing_Software__action_display_num_1107379214.html
but I think that this is an approximation, and I can't have this approximations for what I'm doing in.
 
Finally, I was wondering that if there's no method available for drawing a real quadratic Bezier, would it be possible to implement it, or get the code from the already implemented cubic bezier in Processing to tune it a little bit for our needs
 
Finally again, if it wasn't possible to have acces to the code (yet), I was wondering if somebody could give me some details of the implementation:
- algorithm used
- number of segments (the u parameter step for the Bezier
- type of interpolation between the steps fo the Bezier:
  + linear
  + curve
  + or other
 
So I can implemented in a similar way in order to mantain the same aesthetic as the rest of Processing.
 
thanks,
 
Ricard
 
PS: it would also be nice to control the amount of segments calculated when rendering a bezier (something like the smooth() or framerate() command).
« Last Edit: Feb 18th, 2005, 2:20am by Ricard »  
fry


WWW
Re: quadratic Bezier ??
« Reply #1 on: Feb 19th, 2005, 2:46am »

as florian mentioned in the other thread, you can do a quadratic by doubling up the control points.
 
but you probably want bezier(), not curve(). curve is a catmull-rom curve (more intuitive for general drawing), not a bezier.  
 
and to set the number of segments, use bezierDetail() or bezierSegments() (depends on which version of processing you're using, or it might not be available at all.. i have trouble keeping track sometimes)
 
Pages: 1 

« Previous topic | Next topic »