1,cubic-bezier

vector start = point(0,"P",0);
vector end = point(0,"P",@numpt-1);

vector range_01 = fit(@ptnum,0,@numpt-1,0,1);
float ix = range_01.x;

float dx = end.x - start.x;
float dy = end.y - start.y;

vector p2 = set(start.x + dx * 0.5 , start.x + dy * 0.1, 0 );
vector p3 = set(start.x + dx * 0.5 , start.x + dy * 0.9, 0 );


float x= pow((1-ix),3) * start.x + 3* pow((1-ix),2) * ix * p2.x + 3*(1 - ix)* pow(ix,2) * p3.x + pow(ix,3) * end.x;  
float y= pow((1-ix),3) * start.y + 3* pow((1-ix),2) * ix * p2.y + 3*(1 - ix)* pow(ix,2) * p3.y + pow(ix,3) * end.y;  
@P.x = x;
@P.y = y;
View Code

相关文章:

  • 2021-11-09
  • 2021-05-18
  • 2021-07-02
  • 2021-09-30
  • 2021-12-25
  • 2021-12-27
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2021-12-23
  • 2021-10-31
  • 2021-12-10
  • 2021-12-06
相关资源
相似解决方案