skin
-
Introduction
- vertex와 skinning의 의 blend-weight를 묘사하는데 충분한 정보를 포함하고 있다.
-
concepts
- character skinning을 위하여, animation engine은 skined character의 joints (skeleton) 다룬다. 하나의 skin mesh는 joint와 스킨의 기하적인 형태의 mesh vertices를 결합하여 묘사한다. joint는 controlling 알고리즘으로 skin mesh vertices 좌표를 변형 시킨다.
- 일반적인 skinning algorithm blends는 이웃 joint의 weighted value를 따라 영향을 받는다.
- 전통적인 skinning algoritgm 은 geometry(예를들어 mesh의 vertices)의 points를 변형시킨다. 또 노드들의 행렬들( 때때로 joints라 불리우는)과 scalar weights를 사용한 결과의 평균을 변형 시킨다.
-
"skinning"은 두개의 단계를 포함한다.
-
- "skeleton에 skin을 할당"과 같은 예비 처리 단계
- pre-processing의 결과나 skinning information등을 변화시키는 스켈레톤의 포즈 처럼 skin의 모양을 수정하는 skinning algorithm을 실행한다.
다음과 같은 것들이 존재한다. - bind-shape : default shape라 불리우기도 한다. 이것은 skeleton을 튀어오르게 할때 skin의 모양이다. 이것은 각각의 <mesh> vertex와 선택적으로 더해지는 vertex attribute에 대응하는 (요구되어지는) 위치를 포함한다.
- influences : 각각의 <mesh> vertex에 node + weight 쌍의 가변적인 길이의 리스트
- bind-pose : binding 시간의 모든 influences의 변환. 이 것은 node information마다 통상 binding 시간의 local-to-world 행렬의 "bind-matrix"에의해 나타내어진다.
- skinning algorithm에서 모든 변환은 할당에 있어서 연관되어있다. 이렇게 연관된 변환은 스켈레톤의 각각의 노드와 저장된 스키닝 행렬처럼 통상 미리계산되어 진다.
- 정점의 새로운 ("skinned") 위치를 끌어낼때, 영향을 받는 각각의 노드 변환의 skinning matrix는 vertex의 bind-shape position을 변환시키고 blending 가중치를 사용하여 결과를 평균낸다.
- skinning matrix를 이끌어내는 가장 쉬운 방법은 현재의 지역-월드 행렬을 node의 역행렬에 곱하는 것이다. 이것으로 효과적으로 각각의 노드에 bind-pose transform을 캔슬하고 일반적인 skin의 오브젝트 공간에서 작업하게 허락할 수 있다.
- bind process는 통상 다음을 포함한다.
- bind-shape과 같은 skin의 현재shape을 저장한다.
- bind-matrices를 저장하고 연산한다.
- 디폴트 blending 가중치 생성은 통상 몇몇 fall-off function: 주어진 vertex의 부모 joint, 아무리 적어도 그것에 영향을 미친다. 또한 만약 가중치가 0이면, 영향은 무시된다.
- 이것을 마치고 후에, 메시에 painting 을 하기위하여 가중치를 직접 수작업으로 수정하는 아티스트도 있다.
-
Attributes
- source xs:anyURI
-
Related Elements
- parent elements : controller
-
Child elements :
-
<bind_shape_matrix>
- 포지션과 블렌딩 전의 기본 mesh의 방위같은 부가 정보를 제공한다. 16 플로팅 포인트 숫자들은 4by4 행렬을 상징한다. (column-major order)
- 사람들이 읽는 COLLADA doc에서는 row-major order로 쓰였다.
- 만약 <bind_shape_matrix>가 명확하지 않다면 identity matrix를 <bind_shape_matrix>처럼 쓰게 될 것이다.
- 포지션과 블렌딩 전의 기본 mesh의 방위같은 부가 정보를 제공한다. 16 플로팅 포인트 숫자들은 4by4 행렬을 상징한다. (column-major order)
-
<source>
- 메시를 skinning하는데 필요한 대부분의 데이터를 제공한다
-
<joints>
- joint단위집합의 정보는 skin에 필요하다
-
<vertex_weights>
- joint의 조합은 vertex단위로 묘사되고 skin의 가중치로 사용된다. -1 부터 시작하는 조인트 배열 인덱스가 할당된 shape에 참조된다. 가중치는 사용되기 전에 정규화 되어야만 한다.
- <extra>
-
-
Details
-
bind shape의 각각의 veretex v의 skinning 연산은 다음과 같다.
outv = SUM{ ( ( v * BSM ) * IBSMi * JMi ) * JW } ( i=0~n)- n : vertex v에 영향을 주는 joint의 개수
- BSM : bind shape matrix
- IBMi : inverse bind matrix of joint i
- JMi : joint i 의 joint matrix
- JW : vertex v의 joint i의 joint weight/influence
-
Common optimizations include:
- (v * BSM)은 연산되고 로드된 시간을 저장한다
-
Definitions related to skinning in COLLADA:
- Bind Shape (or base mesh) : mesh의 정점들은 <skin> 엘리먼트의 source 어트리뷰트에 의해 참조된다.
- joints : <soruce>안의 SID의 Nodes specified는 semantic = "JOINT"인 <input> (unshared) 엘리먼트에 의해 참조된다.
SID는 한 SID(node)에 한개의 이름으로 나타내는 <Name_array>안에 전형적으로 저장된다. 스킨 컨트롤러의 인스턴스화에 따라, <skeleton> 엘리먼트는 SID를 조회하는 것을 시작으로 정의된다.
joint 행렬들은 이러한 노드로부터 runtime에 획득된다. - weights : <input>에 의해 참조되는 <source>의 값으로 semantic = "weight"이다. 전형적으로 <float_array>에 저장되며 시간마다 한개의 부동 소수점 값이다.
<vertex_weight>엘리먼트는 joint와 weight의 조합으로 묘사되며 skin에 사용되어진다. - Inverse bind matrix : <input>에 의해 사용되어지는 <source>엘리먼트의 값으로 semantic = "INV_BIND_MATRIX"이다. 전형적으로 부동소수점 값으로 시간당 16개이다. <joints> 엘리먼트 관련하여 그들의 역행렬화 하는 매트릭스이다.
- Bind Shape matrix : skinning 전 bind shape의 변환을 나타내는 한개의 행렬
-
-
Example
-
Here is an example of a <skin> element with the allowed attributes:
<controller id="skin">
<skin source="#base_mesh">
<source id="Joints">
<Name_array count="4"> Root Spine1 Spine2 Head </Name_array>
...
</source>
<source id="Weights">
<float_array count="4"> 0.0 0.33 0.66 1.0 </float_array>
...
</source>
<source id="Inv_bind_mats">
<float_array count="64"> ... </float_array>
...
</source>
<joints>
<input semantic="JOINT" source="#Joints"/>
<input semantic="INV_BIND_MATRIX" source="#Inv_bind_mats"/>
</joints>
<vertex_weights count="4">
<input semantic="JOINT" source="#Joints"/>
<input semantic="WEIGHT" source="#Weights"/>
<vcount>3 2 2 3</vcount>
<v>
-1 0 0 1 1 2
-1 3 1 4
-1 3 2 4
-1 0 3 1 2 2
</v>
</vertex_weights>
</skin>
</controller>
-
이 글은 스프링노트에서 작성되었습니다.
'COLLADA Specification' 카테고리의 다른 글
[COLLADA 2.0 Controller] vertex_weights (0) | 2010.11.09 |
---|---|
[COLLADA 2.0 Controller] skeleton (0) | 2010.11.09 |
[COLLADA 2.0 Controller] library_controllers (0) | 2010.11.09 |
[COLLADA 2.0 Controller] joints (0) | 2010.11.09 |
[COLLADA 2.0 Controller] instance_controller (0) | 2010.11.09 |