일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- 스프링
- 게임개발동아리
- UNIDEV
- 개발공부
- 프로그래밍
- 42서울
- 백엔드
- 라피신
- 생활코딩
- 인프라
- UNICON
- 오블완
- 위키북스
- 백엔드개발자
- 프리티어
- EC2
- AWS
- 온라인테스트
- 체크인미팅
- 도커
- Developer
- UNICON2023
- 자바개발자
- 인디게임
- 스프링부트
- 전국대학생게임개발동아리연합회
- CICD
- RDS
- 배포
- 티스토리챌린지
- Today
- Total
Hyun's Wonderwall
[가상현실] 유니티 AR 카메라로 사진 촬영 본문
모바일 AR로 카메라 기능을 구현해 3D 캐릭터와 사진을 촬영하려고 한다.
유니티에 Android 모듈이 준비되어있는 상태에서 시작했다.
Vuforia Engine
1. 작업할 유니티 프로젝트를 준비한다.
2. Vuforia 사이트에서 유니티용 SDK를 다운로드한다.
(아래의 링크에서 첫번째 옵션인 "Add Vuforia Engine to a Unity Project or upgrade to the latest version"을 클릭)
https://developer.vuforia.com/downloads/sdk
SDK Download | Engine Developer Portal
Use Vuforia Engine to build Augmented Reality Android, iOS, and UWP applications for mobile devices and AR glasses. Apps can be built with Unity, Android Studio, Xcode, and Visual Studio. Vuforia Engine can be easily imported into Unity by downloading and
developer.vuforia.com
3. 유니티 프로젝트에서 Assets > Import Package한다.
Unity AR Foundation, Google ARCore
1. 이 자료를 읽어보고 둘의 관계를 이해한다. https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@6.0/manual/index.html
AR Foundation | AR Foundation | 6.0.1
AR Foundation AR Foundation enables you to create multi-platform augmented reality (AR) apps with Unity. In an AR Foundation project, you choose which AR features to enable by adding the corresponding manager components to your scene. When you build and ru
docs.unity3d.com
2. google-ar 깃허브 arcore-unity-extensions 레포지토리의 릴리즈에서 패키지를 다운받는다.
나는 "arcore-unity-extensions-1.42.0.tgz" 를 설치했다.
https://github.com/google-ar/arcore-unity-extensions/releases
3. 유니티 프로젝트에서 Window > Package Manager 를 열고 + 옆의 ▾를 눌러 "Add package from tarball"로 패키지를 임포트한다.
4. 유니티 프로젝트에서 File > Build Settings에서
- Platform에서 Android로 플랫폼을 변경하고
- Player Settings > XR Plug-in management에서 Plug-in Providers를 Google ARCore로 선택한다.
5. 컴퓨터의 파일 탐색기로 프로젝트 경로에서 ExternalDependencyManager 패키지를 검색해서(나는 Library 하위에 있었던 것 같다) 잘라내기로 Assets 하위로 이동시킨다.
~ EDM4U 관련 에러 해결 ~
Assembly 'Assets/ExternalDependencyManager/Editor/Google.IOSResolver.dll' will not be loaded due to errors:
Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
유니티에 IOS 모듈이 없다면 이렇게 IOSResolver.dll 에러가 뜰 텐데, IOSResolver의 Validate References를 체크 해제하거나 IOS 모듈을 설치해준다.
AR로 사진 찍기 구현
1. 먼저 아래의 영상을 따라하였다.
Take & Save Photos from Camera in AR Unity
2. 그다음, 안드로이드 휴대폰의 갤러리에서 볼 수 있도록 파일 경로를 설정하였다.
- PC 유니티 에디터로 테스트할 때와 모바일 빌드로 플레이할 때의 저장 경로를 다르게 설정했다 (그렇지 않으면 에러)
[Unity]화면 스크린샷 찍고 갤러리에 저장하기(Android, IOS)
[Unity]화면 스크린샷 찍고 갤러리에 저장하기(Android, IOS)
[Unity]화면 스크린샷 찍고 모바일 갤러리에 저장하기(Android, IOS) 게임을 만들다 보면 스크린 샷을 찍어서 갤러리에 저장 할 일이 종종 있다. 이번 포스팅은 스크린 샷 찍고 갤러리에 저장하는 기
chung-develop.tistory.com
[UnityAndroid] NativeCamera API 사진 촬영하고 내부저장소에 저장하기
[UnityAndroid] NativeCamera API 사진 촬영하고 내부저장소에 저장하기
Native Camera for Android & iOS | Integration | Unity Asset Store Native Camera for Android & iOS | 기능 통합 | Unity Asset Store Use the Native Camera for Android & iOS from yasirkula on your next project. Find this integration tool & more on the Unit
altongmon.tistory.com
3. ARCamerManager를 사용해 카메라 전환 기능을 넣었다. 아래의 글을 참고했다.
In Unity, why can I switch the Camera to WorldView with a button press but cannot do it in the Start or Update loop while also u
I'm working on a Unity AR game in which I'd like to start out using the Face Manager to track Face Pose on the World-Facing Camera. I know for a fact that you can track Face Pose with the World Cam...
stackoverflow.com
다음 목표는 카메라 UI에 갤러리 보기 구현하기, 화면에 3D 오브젝트 띄우기이다.
'Study > Unity, C#' 카테고리의 다른 글
[유니티] 프로젝트 깃허브 머지 후 한글 깨짐, 흰 네모, 폰트 충돌 (0) | 2024.07.10 |
---|---|
유니티 - 버튼 텍스트, TextMeshPro 가로세로 폭 맞추기 (0) | 2024.01.22 |
유니티 페이드 인&페이드 아웃 효과 주기 - Panel의 불투명도를 조절 (0) | 2024.01.21 |
유니티 에러 - [Collab] Collab service is deprecated and has been replaced with PlasticSCM (0) | 2024.01.01 |
[유니티 공부] 랜덤 확률 버튼 미니게임 (0) | 2024.01.01 |