VR 콘텐츠 기초 27

[Meta Quest, VR, Oculus] Custom Hand, Ray 위치조정, Button Event Trigger

Asset에서 받아온 Hand Ray의 포인터 위치를 바꾸는 스크립트 offset Button Event Trigger 버튼을 누르면 선택되었다는 표시 느낌으로 빨간색 테두리가 생기게 했다. using System.Collections; using System.Collections.Generic; using UnityEngine; public class btn : MonoBehaviour { [SerializeField] private GameObject selected; public void onSelect() { this.selected.SetActive(true); } public void onDeSelect() { this.selected.SetActive(false); } } 구성 Selecte..

VR 콘텐츠 기초 2023.10.27

[Meta Quest, VR, Oculus] FlatUnityCanvas, Canvas, RayExamples, VR에서 Ray로 Button 누르기

구성 Pointable Canvas : 마우스를 올렸을 때 OVR Canvas Mesh Renderer : Rendering 해주는 역할 OVRCanvas Inspector Pointable Canvas Mesh의 Forward Element에 OVRCanvas - PointableCanvas가 Ray 감지 역할을 하는 것 같음 이걸 넣지 않으면 Button 클릭이 안됌 Pointable Canvas의 Forward Element에 넣지 않는 이유는 Mesh [none] Mesh Fillter : 동적으로 Mesh를 가져옴 Canvas - Canvas Render Texture - 필수 PointableCanvasModule(EventSystem) Unity 에서 사용하는 btn onClick을 해서 D..

VR 콘텐츠 기초 2023.10.26

[Meta Quest, VR, Oculus] 손가락에서 Ray, Line Renderer 쏘기, 핸드 트리거 누르면 Line 쏘기(Hand Trigger), 목표거리까지 Line Renderer 생성하기

1. b_l_index_null 3번째꺼가 검지 손가락 끝에 위치함 2. Project Settings > Player > Rendering > Graphics APIs > + 버튼으로 OpenGLES3 추가 3. XR Plug-in Management > Oculus > Stereo Rendering Mode > Multi Pass 로 변경 4. 쏘고싶은 손 XXXHand > HandInteractorsXXX의 자식으로 Empty GameObject 생성 후 UIHandRayInteractor 이름변경 5. UIHandRayInteractor의 자식으로 Line 생성 6. UI Hand Ray Interactor Script 결과 Line Renderer 그리기 전 Ray 쏴보기 using System..

VR 콘텐츠 기초 2023.10.26

[Meta Quest, VR, Oculus] 광선 상호작용(레이, Create Ray Interactions)

1. HandRayInteractor prefab을 HandInteractorsXXX의 자식으로 넣기 2. HandInteractorsXXX > Best Hover Interactor Group > Interactors에 HandRayInteractor 넣기 3. Cube 만들기 4. Empty GameObject 만들어서 Collider로 수정한 후 Cube의 자식으로 넣어주기 5. Cube > Ray Interactable 추가해주고 Surface에 Collider 넣기 6. Collider > Collider Surface 추가해주고 Collider에 Collider 넣기 Visuals가 보여주는 Ray UI이다. https://developer.oculus.com/documentation/unit..

VR 콘텐츠 기초 2023.10.26

[Meta Quest, VR, Oculus] 기본 세팅, VR 시뮬레이터 (Oculus Integration, VR Simulator)

Oculus 기본 Import 1. Build Setting > Android > Switch Platform 2. https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022 Oculus Integration | 기능 통합 | Unity Asset Store Use the Oculus Integration from Oculus on your next project. Find this integration tool & more on the Unity Asset Store. assetstore.unity.com 3. Oculus Integration Unity 프로젝트에 가져와서 Import 하기 4. Yes, for th..

VR 콘텐츠 기초 2023.10.26

[Meta Quest, VR, Oculus] 잡는 행동(Grabbable) - 박스 뚜껑 열기

박스여는 행동 박스 구성 BoxLid(위에 파란색 큐브), BoxBase(아래 빨간색 큐브) : 3D Object Cube Box, Hinge : Empty Object HandGrabInteractable : Oculus 폴더의 프리팹 Box Inspector Position 값이 Y축 0.7, Z축 0.5인 이유는 내 시야 기준 편한 곳 Hinge Inspector One Grab Rotate Transformer Rotation Axis : 돌릴 방향 Constraints - Min Angle , Max Angle : 최소, 최대 회전시킬 위치 Grabbable Script BoxLid Inspector HandGrabInteractable Inspector BoxBase Inspector http..

VR 콘텐츠 기초 2023.10.26

[Meta Quest, VR, Oculus] 활성화 상태 사용하기(Use Active State)

한 개의 상태만 사용할 때 1. Cube 구성 [오브젝트 이름변경 - CubeGrab, HandGrabInteractable] 2. CubeGrab에 Interactor Active State component 추가 3. Interactor에 OVRCameraRig > OVRInteraction > OVRHands > LeftHand > HandInteractorsLeft > HandGrabInteractor이거 추가 4. Property Is Selecting으로 변경 5. Cube에 Active State Debug Visual component 추가 7. Active State와 Target에 Cube 추가 여러 상태를 확인할 때 1. CubeGrab에 Interactor Active State 하..

VR 콘텐츠 기초 2023.10.25

[Meta Quest, VR, Oculus] 유령 Icon, Mesh, Line, Hand 만들기 (Create Ghost Reticles, Create Ghost Icon Reticle, Create Ghost Mesh Reticle, Create Ghost Line Reticle, Create Ghost Hand Reticle)

시작 전 멀리있는 물체 잡기 상호작용이 되어있어야함 https://developer.oculus.com/documentation/unity/unity-isdk-create-ghost-reticles/ Create Ghost Reticles | Oculus Developers developer.oculus.com 유령 아이콘 십자선 만들기(Create Ghost Icon Reticle) 1. 빈 오브젝트를 만들고 ReticleLeftHand, ReticleRightHand, ReticleLeftControllerHand, ReticleRightControllerHand 총 4개 빈오브젝트 이름 수정해서 만들기 2. 만든 빈 오브젝트 4개에 ReticleIcon prefab 집어넣기 3. ReticleIco..

VR 콘텐츠 기초 2023.10.25

[Meta Quest, VR, Oculus] 멀리있는 물체 잡기 (Create Distance Grab Interactions)

1. OVRHands > LeftHand > HandInteractorsLeft 에 DistanceHandGrabInteractor prefab 추가하기 2. HandInteractorsLeft의 Inspector에서 Best Hover Interactor Group Scripts에 DistanceHandGrabInteractor 추가하기 3. RightHand에도 적용해주기 - ControllerHands에도 똑같이 적용가능 큐브구성 HandGrabInteractable은 빈 오브젝트로 만들어서 이름 수정해준 것 그리고 빌드하면 큐브가 따라온다. 만약 큐브가 멀리서 따라오지않는다면 큐브구성에서 큐브 자체에 y축과 z축을 변경한게 아닌지 확인

VR 콘텐츠 기초 2023.10.25

[Meta Quest, VR, Oculus] Oculus Link 연결 없이 손 잡는 포즈 만들기 (Create a Hand Grab Pose)

그냥 Hands만 사용하는 경우, OVRLeftHandSynthetic과 OVRRightHandSynthetic을 OVRHands에 부착 각각의 손들로 들어가서 HandVisualsXXX를 비활성화한다. 각각 손들의 HandInteractorsXXX로 들어간다. HandGrabInteractor에 접근한다. HandGrabInteractor의 자식 Visuals에 접근한다. Visuals의 자식 2개가 비활성화 되어 있는데 활성화 시킨다. 그리고 HandGrabVisual에 인스펙터를 들어간다. Synthetic Hand가 비어 있는데 여기에 각각 손에 맞는 OVRXXXHandSynthetic을 assign 해준다. 그 다음 HandGrabGlow의 인스펙터로 접근한다. Hand Renderer, Mat..

VR 콘텐츠 기초 2023.10.24