์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- ํ๋ก๊ทธ๋๋จธ์ค
- Swfit
- Flutter
- ๋ฐฑ์ค
- arkit
- Xcode
- Kuring
- tableView
- SwiftUI
- designpattern
- combine
- XCTest
- SnapKit
- raywenderlich
- BFS
- swift
- RxSwift
- rxcocoa
- ios
- BOJ
- CollectionView
- ํจ์คํธ์บ ํผ์ค
- MVVM
- UIKit
- node.js
- Lv2
- visionOS
- reactorkit
- realm
- TCA
- Today
- Total
๋ชฉ๋กapple/๐ฅฝ VisionOS (7)
lgvv98
# frameSemantics ํ๋ ์์์์ ํ์ฑํ๋ semantic์ ์งํฉ : ์ฝ๊ฒ ๋งํ์๋ฉด ์ฌ๋์ด ์์๋ ๋ฌผ์ฒด๋ฅผ ๊ฐ์ ๋ฌผ์ฒด๋ฅผ ์ด๋ป๊ฒ ๋ณด์ฌ์ง๊ฑด์ง๋ฅผ ๊ฒฐ์ var frameSemantics: ARConfiguration.FrameSemantics { get set } - ARConfiguration.FrameSemantics: ์ฑ์์ ์ฌ์ฉํ ์ ์๋, ์ ํ์ ์ธ ํ๋ ์ ๊ธฐ๋ฅ - ํ๋์ frameSemantic์ ARKit์ด ํ๋ ์์์ ์ถ์ถํ๋ 2D ์ ๋ณด๋ฅผ ๋ํ๋. - 2D์์ ์ ์ฒด(body)๋ฅผ ์ถ์ ํ๋ ๋ฒ static var bodyDetection: ARConfiguration.FrameSemantics // 2D์์ ์ ์ฒด ๊ฐ์ง๊ฐ ํ์ฑํ ๋์์์ ๋ํ๋ด๋ ์ต์ ์นด๋ฉ๋ผ ์์์์ ARKit์ด ์ธ์ํ๋ ์ ์ฒด์ ..
ARKit in iOS iOS ๋๋ฐ์ด์ค ์นด๋ฉ๋ผ ๋ชจ์ ๊ธฐ๋ฅ ๋ฑ ์ฐ๋ฆฌ์ ์ฑ์์ ์ฆ๊ฐ ํ์ค ๊ฒฝํ์ ์์ฑํ๋ ๋ฐฉ๋ฒ์ ๋ํด์ ์์๋ณด์. # ์ฅ์น ๊ถํ ํ์ธ(Verifying Device Support and User Permission) - ์ฑ์ด ARKit์ ์ฌ์ฉํ ์ ์๊ณ , ์ฌ์ฉ์ค์ ๊ทธ ๊ถํ์ด ์๋์ง ํ์ธํด์ผ ํ๋ค. - ARKit์ iOS 11.0 ์ด์ ๊ทธ๋ฆฌ๊ณ A9 ํ๋ก์ธ์ ์ด์์ด ํ์์ ์. ๋ช๋ช ARKit ๊ธฐ๋ฅ๋ค์ ๋ ํน์ ๋๋ฐ์ด์ค์ ๋ ์ต์ ๋ฒ์ ์ด ํ์ํจ. ARKit์ ๋ํ ๋๋ฐ์ด์ค์ ์นด๋ฉ๋ผ๋ฅผ ์ฌ์ฉํ๊ณ , ๊ทธ๋์ iOS์ privacy ๊ถํ์ ์ ์ ๋ก๋ถํฐ ํ์ฉ๋ฐ์์ผ ํจ. ์ฅ์น์ ํธํ์ฑ์ ์ฐ๋ฆฌ๊ฐ ๋ค๋ฃจ๋ ๋ฐฉ๋ฒ์ ARKit์ ์ฐ๋ฆฌ๊ฐ ์ด๋ป๊ฒ ์ฌ์ฉํ๋์ ๋ฐ๋ผ ๋ค๋ฆ. - ๋ง์ฝ ํ๋ฉด ์นด๋ฉ๋ผ๋ฅผ ์ด์ฉํ AR์ ๊ธฐ๋ณธ์ ์ธ ๊ธฐ๋ฅ๋ง ์ฌ..
SCNSceneRendererDelegate SceneKit์ ์ ๋๋ฉ์ด์ ๋ฃจํ์ ๋ค์ด๊ฐ๊ฑฐ๋ ์ถ๊ฐ์ ์ธ ๋ ๋๋ง์ ์ํํ๊ธฐ ์ํด ์ฑ์์ ๊ตฌํํ ์ ์๋ ๋ฉ์๋. protocol SCNSceneRendererDelegate SceneKit์ผ๋ก ๊ฒ์ ๋๋ ์ฑ์ ๋น๋ํ๋ ค๋ฉด SCNView ๊ฐ์ฒด ๋๋ SCNSceneRender ํ๋กํ ์ฝ์ ์ฌ์ฉํ์ฌ scene์ ๋ณด์ฌ์ค ์ ์๋ค. ๊ทธ๋ฐ ๋ค์ ํ๋ ์๋น ๊ฒ์ ๋ก์ง์ ์ถ๊ฐํ๊ฑฐ๋ SceneKit์ด scene์ ๋ ๋๋งํ๊ธฐ ์ ์ด๋ ํ์ ์ฌ์ฉ์๊ฐ ์ง์ ํ Metal ๋๋ OpenGL ๋ ๋๋ง์ ์ํํ๋ ค๋ฉด SCNSceneRendererDelegate ํ๋กํ ์ฝ์ ๊ตฌํํ๋ค. SCNView ๊ฐ์ฒด ํน์ SceneKit ๋ ๋๋ฌ์์ scene์ด ๋ ๋๋ง๋ ๋ ๋ ๋๋ง ๋ฃจํ๋ scene์ ์๋์ ๊ณผ์ ์ ํตํด..
SCNAction ์์ํ๊ธฐ ์ ๊ฐ๋จ์ ๋ฆฌ SceneKit์์ ๋ช ์์ ์ ๋๋ฉ์ด์ : Core Animation SceneKit์์ ์์์ ์ ๋๋ฉ์ด์ : SCNTransaction SCNAction์?: ๊ทธ๋ฃนํ, ์ํ์ค, ์ฑ๊ธ ๋ฑ ์กฐํฉ ๊ฐ๋ฅ. ์ฐ๊ฒฐํ ๋ชจ๋ ๋ ธ๋์ ์์ฑ์ ๋ณ๊ฒฝํ๋ ๊ฐ๋จํ๊ณ ์ฌ์ฌ์ฉ ๊ฐ๋ฅํ ์ ๋๋ฉ์ด์ . class SCNAction : NSObject SCNNode์ก์ ์ด ์ฐ๊ฒฐ๋ ๊ฐ์ฒด์ ๊ตฌ์กฐ์ ๋ด์ฉ์ ๋ณ๊ฒฝํ๊ธฐ ์ํด ์ก์ ์ ์ฌ์ฉํ์ง๋ง ์ก์ ์ ์ฌ์ฉํ์ฌ scene์ ๋ค๋ฅธ ๋ณ๊ฒฝ์ ์ค ์ ์์. SceneKit์์ ์ก์ ์ ์ฌ์ฉ์ ์ ๋ ฅ์ ๋ฐ๋ผ ์์ฃผ ๋ณ๊ฒฝ๋๋ ์ ๋๋ฉ์ด์ ๋์์ ๊ตฌํํ๋ ์ฌ์ด ๋ฐฉ๋ฒ์ ์ ๊ณตํจ. # Working with Actions action์ ์์ฑํ๊ธฐ ์ํด์๋ action๊ณผ ๊ด๋ จ์ด ์๋ ๋ฉ์๋์ ํด..
#3 Animating SceneKit Content ๋ด๊ฐ ๋ง๋ ์ง์ค๋ฉํธ๋ฆฌ๋ค์ ์ด๋ฒคํธ๋ ์ ๋๋ฉ์ด์ ๋ฑ๋ ์ฌ์ฉํ ์ ์๋ค. # Base Code ์ผ๋จ ๊ธฐ๋ณธ์ฝ๋๋ ์ด๋ ๊ฒ ์ฌ๊ธฐ์ ํ๋ํ๋ ์ถ๊ฐํด๋ณด์. func make_image_control() { let scene = SCNScene() arSceneView.scene = scene // ์นด๋ฉ๋ผ ์์ฑ let cameraNode = SCNNode() cameraNode.camera = SCNCamera() cameraNode.position = SCNVector3(x: 0, y: 0, z: 5) scene.rootNode.addChildNode(cameraNode) // Capsule ์์ฑ ๋ฐ ์ถ๊ฐ let capsuleGeometry = SCNCapsule(..
#2 Geometry ๋ค๋ค๋ณด๊ธฐ Geometry ๋ค๋ค๋ณด๊ธฐ - ๋ค์ด๊ฐ๊ธฐ ์ ๊ฐ๋จ์ ๋ฆฌ - Geometry: ์ฐ๋ฆฌ๊ฐ ์ํ๋ ์ด๋ค ๋ฌผ์ฒด (ex. ์ ์ก๋ฉด์ฒด, ๊ตฌ ๋ฑ) - Material: ์ง์ค๋ฉํธ๋ฆฌ ํ๋ฉด์ ์ด๋ค ํจ๊ณผ๋ฅผ ์ฃผ๋๊ฒ (ex. ์ด๋ฏธ์ง ๋ฃ๊ธฐ, ์ ๋ฃ๊ธฐ ๋ฑ) - Node: ARSceneViewํ๋ฉด์ Geometry๋ฅผ ์ถ๊ฐํ ๊ฑด๋ฐ, Node๋ฅผ ํตํด ์ขํ๋ฅผ ์ฃผ์ด ๋ฃ์๋ ์ฌ์ฉ. # SCNGeometry ํด๋์ค material์ด ์ ์๋ ํ๋ฉด์ Scene์ ํ์ํ ์ ์๋ 3์ฐจ์ ๋ชจ์(model ๋๋ mesh๋ผ๊ณ ๋ ๋ถ๋ฆ) SceneKit์์ SCNode ๊ฐ์ฒด์ ์ฐ๊ฒฐ๋ ์ง์ค๋ฉํธ๋ฆฌ๋ Scene์ Visible ์์๋ฅผ ๊ตฌ์ฑํ๋ฉฐ, ์ง์ค๋ฉํธ๋ฆฌ์ ์ฐ๊ฒฐ๋ SCNMaterial ๊ฐ์ฒด๋ ๊ทธ ๋ชจ์์ ๊ฒฐ์ ํฉ๋๋ค. # Working with ..