【发布时间】:2018-08-24 03:59:27
【问题描述】:
我在 AR 屏幕中显示了一个 SCNText 节点。我正在尝试使用 SCNAction 属性对其进行动画处理。但它不能正常工作。 有没有其他方法可以为节点设置动画?
另外,如果我想插入图片来代替文本,我应该怎么做?我知道我不能将它添加为几何图形。那么还有其他方法吗?
谢谢
func displayText() {
let textGeo = SCNText(string: "HELLO WORLD", extrusionDepth: 1.0)
textGeo.firstMaterial?.diffuse.contents = UIColor.black
let textNode = SCNNode(geometry: textGeo)
textNode.position = SCNVector3(0,0.1,-0.5)
textNode.scale = SCNVector3(0.002,0.002,0.002)
self.sceneView.scene.rootNode.addChildNode(textNode)
let action = SCNAction.fadeOpacity(by: 10.0, duration: 5.0)
textNode.runAction(action)
【问题讨论】:
-
请发布您的代码到目前为止...
-
请立即查看
标签: ios swift animation scenekit arkit