0

I'm trying to play 180 fisheye video with scenekit and one of the examples I found is using a sphere as AVPlayers geometry to play 360 degree video.

Problem is the video I'm using is captured with 180° fisheye camera and I need to represent it with a half sphere.

I've been fiddling with the code for 2 days but with no luck.

Since I'm not experienced in this subject, I've tried to put AVPlayer partially onto a full sphere or cut the SCNSphere in half without success.

The code below is for playing 360 video and from simple360player_iOS GitHub repo,

var screenScale : CGFloat                                       = 1.0
        if PROCESSOR_64BITS {
            screenScale                                                 = CGFloat(3.0)
        }

        player                                                          = AVPlayer(URL: fileURL!)
        let videoSpriteKitNodeLeft                                      = SKVideoNode(AVPlayer: player)
        let videoNodeLeft                                               = SCNNode()
        let spriteKitScene1                                             = SKScene(size: CGSize(width: 1280 * screenScale, height: 1280 * screenScale))
        spriteKitScene1.shouldRasterize                                 = true
        var spriteKitScenes                                             = [spriteKitScene1]

        videoNodeLeft.geometry                                          = SCNSphere(radius: 30)
        spriteKitScene1.scaleMode                                       = .AspectFit
        videoSpriteKitNodeLeft.position                                 = CGPoint(x: spriteKitScene1.size.width / 2.0, y: spriteKitScene1.size.height / 2.0)
        videoSpriteKitNodeLeft.size                                     = spriteKitScene1.size
4

1 回答 1

0

设置部分球体、部分映射或其他实现该目标的对象可能是最崇高的路径。但是,根据项目的上下文,如果您有 180 度视频,通常更快地将视频宽度加倍并用黑色或您选择的东西填充额外的空间。如果您将来有可能拥有 360 度全景视频,这将特别有用。

于 2016-08-31T17:47:31.170 回答