전체 글 292

[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