ARで巨大な動画再生モニターを出現させる方法です

現実で大きなスクリーンを設置するには制約がある
ARならどこまでも巨大にできる
手順
垂直面にはりつくアンカーを作成し、100インチサイズのボックスを設置します。
let anchorEntity = AnchorEntity(plane: .vertical)
let monitorEntity = ModelEntity(mesh: .generateBox(size: [2.21,0.2,1.24],cornerRadius: 0.02))
anchorEntity.addChild(displayEntity)
arView.scene.addAnchor(anchorEntity)
ビデオマテリアルをモニターに貼り付けます。
let asset = AVURLAsset(url: videoURL)
let playerItem = AVPlayerItem(asset: asset)
let player = AVQueuePlayer(playerItem: playerItem)
let videoMaterial = VideoMaterial(avPlayer: player)
monitorEntity.model?.materials = [videoMaterial]
player.play()
動画と現実のものをインタラクトすることで新しい効果が生まれるかも?
サンプルコードはこちら
🐣
フリーランスエンジニアです。
お仕事のご相談こちらまで
rockyshikoku@gmail.com
Core MLやARKitを使ったアプリを作っています。
機械学習/AR関連の情報を発信しています。