How to make SCNNode is always toward to ARFrame.camera

百般思念 提交于 2019-12-24 06:59:10

问题


- (void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame {
    SCNNode *shipNode = self.sceneView.scene.rootNode.childNodes[0];
    if (shipNode) {
        shipNode.eulerAngles = SCNVector3FromFloat3(frame.camera.eulerAngles);
    }
}

I want to change ship's orientation with camera's moving, but the above code seems useless.


回答1:


Use an SCNBillboardConstraint to keep one node pointed toward another node.



来源:https://stackoverflow.com/questions/44921072/how-to-make-scnnode-is-always-toward-to-arframe-camera

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!