2011-08-27 8 views

답변

1

B- 스플라인에는 여러 유형이 있습니다. 그래도 B- 스플라인을 베 지어로 분할한다고 상상해보십시오. 커브를 반복 할 것이고, 각 커브마다 라인에서 커브를 그릴 수 있도록 특정 디테일로 포인트를 횡단합니다.

private function curve(control1:Point,anchor1:Point,control2:Point,anchor2:Point,t:Number):Point{ 
      var result:Point = new Point(); 
      var tSquared:Number = t*t; 
      var tCubed:Number = t*t*t; 
      result.x = tCubed*(anchor2.x+3*(control1.x-control2.x)-anchor1.x) 
             +3*tSquared*(anchor1.x-2*control1.x+control2.x) 
             +3*y*(control1.x-anchor1.x)+anchor1.x; 
      result.y = tCubed*(anchor2.y+3*(control1.y-control2.y)-anchor1.y) 
             +3*tSquared*(anchor1.y-2*control1.y+control2.y) 
             +3*y*(control1.y-anchor1.y)+anchor1.y; 
      return result; 
     } 

Paul Tondeur's Drawing a cubic curve blog entry 살펴뿐만 아니라 거기에 대한 참조를 가지고 :

여기에 빠른 조각입니다.

HTH

+0

+1. 좋은 리소스. 관심이있는 경우 입방체 베 지어 곡선은 Flash Player 11의 Drawing API에서 (마지막으로) 지원됩니다. – TheDarkIn1978

관련 문제