출처는 [[http://docs.fluffyunderware.com/curvy/orientation.html|온라인 문서]] ====== 개념 ====== ===== Curvy 스플라인의 구성 요소 ===== | {{:language:unity:curvy:curvy_spline_anatomy.png|}} | | 그림은 온라인 문서에서 가져온 것 | = spline : 붉은색 부분의 최종 결과물. 세그먼트Segment가 모여서 만들어진다. = : 그림에서는, 3개의 세그먼트Segment, 4개의 컨트롤포인트Control Point로 구성되어 있다. = Control Point : 곡선(휘어지는부분)을 정의할 때 사용 = Segment : 두 Control Point 사이의 구간. 에디터에서 선택된 세그먼트Segment는 흰색으로 표시. = Approximation : 내부 처리를 위해서 만들어지는 직선 구간. = Tangents : 스플라인 각 접점의 방향. Build by the difference between a sampled position and the last sampled position. = : (그림에는 표시가 없다.) = Up-Vectors : 정방향의 위치 ====용어==== 스플라인에서 특정 부분(지점)의 값을 얻어다 쓰려면 사용할 수 있는 방법 * F * Distance {{:language:unity:curvy:curvy_spline_overview_terms.png|}} = TFTotal Fragment : 첫번째 컨트롤포인트CP,Control Point부터 마지막 컨트롤 포인트까지의 상대적인 거리. 첫번재 CP는 0이며 마지막 CP 1.0이 된다. = local F : 특정세그먼트 구간에서의 상대적인 거리. 시작 CP는 0, 다음 CP는 1.0이 된다. = Distance : 월드 유닛World Unit 단위로 설정되는 길이 값. (첫번째 CP ~ 마지막 CP까지의 거리) = local Distance : 특정 세그먼트에서의 길이값. (해당 세그먼트의 시작 CP ~ 다음 CP까지) ===== Orientation ===== ==== Tangents ==== * 커브의 방향 또는 휘어진 상태를 가리킨다. * 특정 위치P(f)탄젠트Tangent는 인접한 포인트P(f+n)의 방향으로 결정된다. * 탄젠트는 다른 곳에서는 노말Normals,노말벡터라고 부른다. ==== Up-Vectors ==== * 스플라인을 따라 움직이는 경우, 탄젠트와는 별도의 방향 벡터가 필요하다. * 일반 용어로는 binormal 이라고 한다. * 탄젠트와 Up-Vector로 평면이 구성되는데 어느쪽이 정방향인지 표시된다. Up-Vector를 계산하는 방법 * CPControl Point : CP의 로테이션 상태에 영향을 받는다. * Tangent : (모르겠음) the Up-Vector is calculated by transporting an initial Up-Vector through the curvation of the curve using the Parallel Transport Frame algorithm ==== Swirling ==== * 탄젠트 정방향에 좀 더 소용돌이 모양의 휘어짐을 추가할 수 있다.(는 뜻이 아닐까?) ==== normal, binormal ==== 그림상으로 이러함 | {{:language:unity:curvy:curvy_tangent_binormal_1.png|}} | | {{:language:unity:curvy:curvy_tangent_binormal_2.jpg|}} | | {{:language:unity:curvy:curvy_tangent_binormal_3.gif|}} | ===== 곡선에 대한 외부 레퍼런스 ===== * [[http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/curves/normal.html|Normal Vector and Curvature]] * [[http://homepages.inf.ed.ac.uk/rbf/CVDICT/cvc.htm|Illustrated Dictionary of Computer Vision: C]] * [[http://gamedev.stackexchange.com/questions/25596/opengl-create-tunnel-triangles-and-texture-coords-on-a-3d-path|Opengl create tunnel TRIANGLES and texture coords on a 3d path]] * [[https://www.google.co.jp/search?q=binormal&espv=210&es_sm=93&tbm=isch&tbo=u&source=univ&sa=X&ei=wyjJUtqXNsXZkAXLtYGgAQ&ved=0CDcQsAQ&biw=1017&bih=926#imgdii=_|binormal 검색후 관련 사이트가 보이는]] * [[http://www.jug.net/wt/tj1wmtsu.htm|Tangent, Normal and Binormal Vectors for Physics of Walking, Marching, and Tossing, 교재인듯]] ===== Granularity, Caching ===== (대략)밀도, 캐싱에 대해서 ====Caching==== * 속도를 위해 캐싱을 사용. * 길이(Auto Refresh Length)와 정방향Orientation(Auto Refresh Orientation)에 대한 옵션을 끄면 캐쉬는 사라진다. * Auto refresh를 Disable해도 캐쉬는 사용되지 않는다. * 캐쉬를 쓰지 않으면, **성능문제**가 있다는데. ====Granularity==== * 캐슁할때의 샘플랭 데이터의 양(개수) * 20이라고 설정하면 한 세그먼트당 20개의 샘플포인터를 저장한다. * Granularity는 한 샘플 포인트가 Approximation에 얼마나 가까운가를 저장한다. ====== 에디터 통합 기능 ====== =====CurvySpline===== 신규 스플라인을 만든다. * [[http://docs.fluffyunderware.com/curvy/curvyspline.html|CurvySpline 온라인 문서 위치]] ====생성==== * GameObject -> Create Other -> Curvy -> Spline ====Spline Inspector==== * Interpolation : 커브 타입 * Linear : 직선 * Catmul-Rom : CP간 부드러운 커브 * TCB : Kochanek-Bartels 스플라인. 특징이 뭐지? * Bezier : 베지어 스플라인. 별도의 핸들러. * Close Spline : 닫힌 스플라인인가 * Auto End Tangents : CR에 필요한 추가 ControlPoint. \\ TCB 스플라인에는 자동 생성 된다. * Granularity : 한 세그먼트에 캐쉬를 만들때 필요한 샘플링 개수. **Orientation** * Orientation : Orientation이 어떻게 계산 되는가? * None : 대충 찍기 * Control Point : CP간 직선 거리와 CP의 회전 상태에 따라 * Tangent : 커브의 휘어진 상태를 보고 결정 * Set CP Rotation : CP의 회전 상태를 스프라인의 Orientation에 맞출 것인가? (맞나?) * Initial UP-Vector : Up-Vector를 결정하는 방법 (Tangent-Orientation only) * Control Point : 첫째 CP의 상태에 따라. ( 첫세그먼트의 첫 CP를 회전해서 조정) * MinAxis : 근처의 첫번째 targent를 보고 (이웃따라 같이) * Swirl : Up-Vector를 더 휘게 만든다. * None : 안함 * Segment : 세그먼트 구간당 * Spline : 스플라인 전체에 적용 * Turns : Swirl의 각도 **TCB** * TCB라는 스플라인 알고리즘이 있나보네. * Tension - Global Tension (TCB splines only) * Continuity - Global Continuity (TCB splines only) * Bias - Global Bias (TCB splines only) * Set Catmul - Set Global TCB values to represent a CR spline (TCB splines only) * Set Cubic - Set Global TCB values to represent a Cubic Hermite spline (TCB splines only) * Set Linear - Set Global TCB values to represent a linear spline (TCB splines only) Miscellaneous * UserValueSize : Vector3를 한개 이상 넣을 수 있는 듯. ==== Spline Action ==== 더 할 수 있는 것들 * Align Wizard : ? * Mesh Export Wizard : ? * Center Pivot : 현재 스플라인의 중심(?) 찾기(?) * Flip Spline : 스플라인 반전. 첫번째 CP가 마지막 CP가 된다. =====CurvySplineSegment===== =====CurvySplineGroup===== =====SplineShapes===== =====SplinePathCloneBuilder===== =====SplinePathMeshBuilder=====