Unity VR Build a Custom Hand Pose (Oculus Integration SDK)
Unity VR Build a Custom Hand Pose (Oculus Integration SDK)
Build a Custom Hand Pose
https://youtube.com/playlist?list=PLTFRwWXfOIYB9hru6EjeVS0E-4jNiOuQQ&si=zoJ3NoYX6YrGnpg1
Unity VR with Oculus Integration 57.0
Unity VR with Oculus Integration
www.youtube.com
핸드 트래킹 기본형을 만들어 준다
이 튜토리얼에서는 양손에 대한 엄지손가락 포즈를 구성하여 처음부터 사용자 정의 손 포즈를 만드는 방법을 배웁니다.
컨트롤러 및 손 컨트롤러에는 사용자 정의 손 포즈가 지원되지 않습니다.
포즈를 만들려면 손을 추적하고, 포즈의 모양과 변형을 정의하고, 활성화될 때 실행할 이벤트를 선택합니다.
이 튜토리얼에서 사용된 포즈 인식 및 구성 요소에 대한 자세한 설명은 손 포즈 감지를 참조하세요.
사전 구축된 장면에서 포즈 인식을 시도하려면 PoseExamples 장면을 참조하세요.

엄지손가락을 위로 포즈를 취하는 데 사용할 모양(엄지손가락을 펴고 모든 손가락을 닫음)과 변형(손목 위로)을 사용합니다.
Before You Begin
- Complete Getting Started with Interaction SDK.

Pose 자식으로 빈오브젝트를 하나 더 만든다

V Sign Right를 선택하고 HandRef 컴포넌트를 부착 한다

Hand Ref의 Hand프로퍼티에 LeftHand를 넣어준다

V Sign Right오브젝트를 선택해
Shape Recogniger Active State 컴포넌트를 부착 한다

Hand 프로퍼티에 LeftHand를 넣어 준다

LeftHand를 열어 HandFeatureLeft를 선택하고

Finger Feature State Provider 컴포넌트를 부착 한다

Finger Feature State Provider컴포넌트의 Thresholds의 카운트를 5로 설정하고 Finger 속성을 다음과 같이 설정 한다

State Thresholds에 각 Default 에셋을 넣어준다
Ring, Pinky에는 DefaultFingerFeatureStateThresholds를 넣어 주자

이제 프로젝트 창에서 Pose 폴더를 만들고

Oculus > Interaction > SDK > Pose Detection > Shape 를 선택해 에셋을 만든다


V Sign 의 각 손가락 관절을 생각해보고 Feature Config를 설정한다

Thumb Feature Configs
이때 엄지에는 Flexion을 적용하지 않는다


손가락이나 엄지손가락의 위쪽 두 관절이 얼마나 구부러졌는지 나타냅니다.
이 기능은 근위(너클) 관절을 고려하지 않습니다.
Open(열림): 손가락이 완전히 곧게 펴집니다.
중립: 마치 커피 머그를 감싸듯이 손가락이 안쪽으로 약간 구부러져 있습니다.
닫힘(사진): 손가락 끝이 손바닥에 거의 닿을 정도로 안쪽으로 촘촘하게 말려 있습니다.

다음과 같이 엄지의 Curl 은 Is Not Open

또는 Is Closed 를 선택 한다
다만 V Sign은 Closed보다는 Open되어 있지 않는 상태로 만드는게 더 잘 인식 할듯 하다
(닫힘(사진): 손가락 끝이 손바닥에 거의 닿을 정도로 안쪽으로 촘촘하게 말려 있습니다)

Index Feature Configs / Middle Feature Config 는 곧게 펴있음으로 Is Open을 선택 한다
그리고
Flexion설정도 해주자
근위(관절) 관절이 손바닥에 비해 구부러지는 정도입니다.
굴곡은 네 손가락에만 가능합니다. 이는 엄지 손가락에 잘못된 긍정을 제공할 수 있습니다.

Open: 손가락의 첫 번째 뼈는 완전히 확장되어 손바닥과 평행합니다.
Neutral : 약간 구부러짐.
Closed : 너클 조인트가 완전히 구부러진 상태입니다(사진).
Flexion설정은 Is Open상태로 해주자
V Sign은 Index, Middle 손가락이 손바닥과 어느정도 평행 하기 때문이다

Ring / Pinky Feature Config는 손끝이 손바닥에 가깝게 붙어있기때문에 Is Not Open으로 설정 하고

그리고 Flexion도 설정하자
Closed : 너클 조인트가 완전히 구부러진 상태입니다(사진).

모든 Thresholds 설정이 끝났다
다시 V Sign Right 오브젝트를 선택하고

Shape Recognizer Active State컴포넌트의 Finger Feature State Provider 프로퍼티에 Left Hand / Hand Feature Left오브젝트를 넣어준다

이어서 Shapes 프로퍼티의 + 버튼을 눌러 필드를 만들고

아까 만든 V Sign 에셋을 넣어준다

V Sign Right 오브젝트를 선택하고 Active State Selector컴포넌트를 부착 한다


Active State 프로퍼티에 위에 있는 Shape Recognizer Active State컴포넌트를 넣어 준다

V Sign Right 오브젝트에 Selector Unity Event Wrapper 컴포넌트를 붙여 주자

Selector 프로퍼티에 Active State Selector 컴포넌트를 넣어 준다

빈 오브젝트 Debug 를 만들고

그 자식으로 Cube하나를 만들자

Selector Debug Visual컴포넌트를 부착 하고 위치와 크기를 조절 한다

Selector 프로퍼티에 V Sign Right게임 오브젝트를 넣어 주고

Renderer 프로퍼티에 Mesh Renderer를 넣어 준다

모든 설정이 끝났다 실행후 테스트 해본다
다음과 같이 인식이 잘 안될경우
아까 만든 V Sign 에셋을 수정해본다

이전 셋팅

Abduction
변경후 셋팅
인접한 두 손가락 사이의 각도로, 두 손가락의 밑부분에서 측정됩니다.
외전은 주어진 손가락과 새끼손가락에 더 가까운 인접한 손가락 사이의 각도를 측정합니다.
예를 들어 검지의 외전은 검지와 중지 사이의 각도입니다.
Open 두 손가락을 벌립니다(검지 사진).
Closed : 두 손가락이 서로 꽉 압축되어 있습니다(그림에서는 엄지손가락, 중지, 약지).
None : 현재 사용되지 않습니다.

다시 테스트
오히려 더 감지를 잘 못하는듯 하다

Is Closed부분을 Is Not Open으로 바꿔본다

다시 테스트
확실히 이전보다는 잘 인식한다
손바닥이 앞쪽을 향해 있을때 더 잘 인식 한다

가끔 이렇게 손바닥이 얼굴을 향해 있을때도 인식 하는데

이것을 해결 하기위해서 V Sign Right 오브젝트를 선택하고

Transform Recognizer Active State 컴포넌트를 부착 한다

Hand 프로퍼티에 LeftHand를 넣어 준다

LeftHand / HandFeatureLeft를 선택하고

Transform Feature State Provider컴포넌트를 부착 한다

V Sign Right오브젝트를 선택하고
Transform Recognizer Active State컴포넌트의 Transform Feature State Provider프로퍼티에 HandFeatureLeft를 넣어준다

Transform Feature Configs 프로퍼티에서 Palm Away From Face를 선택 한다



이것 이외에도 손목을 기준으로 또는 손가락의 위치를 설정 할수도 있다

마지막으로 Up Vector Type을 World로 설정 한다


Feature Thresholds에 Default Transform Feature State Thresholds를 넣어 준다

이제 Shape과 Transform 을 모두 충족 했을경우 V Sign으로 인정 하게 할 차례다
V Sign Right 오브젝트를 선택하고

Active State Group컴포넌트를 부착 한다

+ 버튼을 눌러 필드 2개 만든후

Shape Recognizer Active State와 Transform Recognizer Active State를 넣어준다

Active State Selector 컴포넌트의 Active State 프로퍼티에 Active State Group을 넣어준다

모든 설정이 끝났다 실행후 테스트 해보자
이제 V Sign을 하고 손바닥이 밖을 향할때만 인정 되어야 한다
한가지 문제점이 있는데 손목의 방향이다
이렇게 했을때 V Sign으로 인정되어서는 안된다

V Sign Right를 선택하고


Fingers Up 을 추가 한다

테스트 해본다
만족스러운 결과가 나왔다
이런 게임에서 사용해보면 잼있을듯 하다
핸드포즈를 사용한 VR 게임 (Maestro VR)
https://store.steampowered.com/app/1327920/Maestro_VR/?l=koreana
Maestro VR on Steam
Maestro VR is an immersive rhythmic music video game where you become an orchestra conductor in Virtual Reality. Experience the thrill of conducting a symphony orchestra like never before. Feel the music in a way that's unique and unparalleled.
store.steampowered.com
https://www.youtube.com/watch?v=li0xzG_Nn9Q
참고
https://developer.oculus.com/documentation/unity/unity-isdk-building-hand-pose-recognizer/