๐ท Occlusion culling
- ์ฑ ์ ๋ฐ์ ์์ฑํ ์บ๋ฆญํฐ๊ฐ ์๋ณด์ด๋๋ก ์ฒ๋ฆฌ
๐ถ Face Detecting ์ค์ ์ด๊ธฐํ

- ์ ์ปดํฌ๋ํธ 2๊ฐ ํ์ฑํ
- ์๋ ์ปดํฌ๋ํธ 2๊ฐ ๋นํ์ฑํ

- Facing Direction : World
๐ถ ์บ๋ฆญํฐ ์์ฑ ๋ฐ culling ์ฒ๋ฆฌ

- ์ํ๋ ์ค๋ธ์ ํธ ์์ฑ
- Scale ์กฐ์
- ํ๋ฆฌํนํ ํ ํ์ด์ด๋ผํค์ฐฝ์์ ์ญ์

- ์ปดํฌ๋ํธ ์ถ๊ฐ
- AR Raycast Manager

- ์คํฌ๋ฆฝํธ ์์ฑ : PlacerMgr
- AR Session Origin ์ค๋ธ์ ํธ์ ์คํฌ๋ฆฝํธ ์ถ๊ฐ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARSubsystems;
public class PlacerMgr : MonoBehaviour
{
public GameObject monsterPrefab;
private List<ARRaycastHit> hits = new List<ARRaycastHit>();
private ARRaycastManager raycastManager;
void Start()
{
raycastManager = GetComponent<ARRaycastManager>();
}
void Update()
{
if (Input.touchCount == 0) return;
Touch touch = Input.GetTouch(0);
if (touch.phase == TouchPhase.Began)
{
if (raycastManager.Raycast(touch.position, hits, TrackableType.All))
{
GameObject obj = Instantiate(monsterPrefab, hits[0].pose.position, hits[0].pose.rotation);
}
}
}
}
-

- ์ฐ๊ฒฐ

- ์ปดํฌ๋ํธ ์ถ๊ฐ
- AR Occulusion Manager
- Build & Run
'Unity > AR' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
11. AR Foundation - Cloud Anchor (2) Local Anchor (0) | 2021.09.21 |
---|---|
10. AR Foundation - Cloud Anchor (1) Setting (0) | 2021.09.20 |
08. AR Foundation - ์ผ๊ตด ์ธ์ (0) | 2021.09.17 |
07. AR Foundation - ์ค์น (2) | 2021.09.16 |
06. ARCore - ์ ๋ง๋ค๊ธฐ (0) | 2021.09.15 |