小编jgl*_*sse的帖子

SKVideoNode(嵌入在SKScene中)作为Scene Kit节点无法正常工作的纹理

我正在尝试使用Scenekit将视频作为纹理映射到VR项目的原始柱面:一个嵌入在SKScene中的SKVideoNode作为SceneKit SCNTube对象的纹理,我只是无法将视频显示为静止图像会.下面的PLayground代码应生成映射到柱面的移动视频,但映射不起作用:

编辑:在上市结束时添加单行修复.以下代码应该工作

import UIKit
import SceneKit      // for 3D mapping
import SpriteKit     // for SKVideoNode
import QuartzCore    // for basic animation
import XCPlayground  // for live preview
import AVFoundation  // for video playback engine

// create a scene view with an empty scene
var sceneView = SCNView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
var scene = SCNScene()
sceneView.scene = scene


// start a live preview of that view
XCPShowView("The Scene View", view: sceneView)

// default lighting
sceneView.autoenablesDefaultLighting …
Run Code Online (Sandbox Code Playgroud)

avfoundation ios scenekit sprite-kit virtual-reality

7
推荐指数
1
解决办法
3253
查看次数