Slide 147
Slide 147 text
static func makeVideoMesh(videoInfo: VideoInfo) async -> (
mesh: MeshResource, transform: Transform)? {
let horizontalFieldOfView = videoInfo.horizontalFieldOfView ?? 65.0
let mesh = VideoTools.generateVideoSphere(
radius: 10000.0,
sourceHorizontalFov: horizontalFieldOfView,
sourceVerticalFov: 180.0,
clipHorizontalFov: horizontalFieldOfView,
clipVerticalFov: 180.0,
verticalSlices: 60,
horizontalSlices: Int(horizontalFieldOfView) / 3)
let transform = Transform(
scale: .init(x: 1, y: 1, z: 1),
rotation: .init(angle: -Float.pi / 2, axis: .init(x: 0, y: 1, z: 0)),
translation: .init(x: 0, y: 0, z: 0))
return (mesh: mesh!, transform: transform)
}